Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create userTrackPurchase table #132

Open
simonv3 opened this issue Oct 21, 2022 · 0 comments
Open

Create userTrackPurchase table #132

simonv3 opened this issue Oct 21, 2022 · 0 comments

Comments

@simonv3
Copy link
Collaborator

simonv3 commented Oct 21, 2022

Right now, whether or not a user owns a track is calculated by the amount of plays the user has for the track.

If a user has 9 plays, they own the track. Conversely, if a user buys a track, we insert 9 plays into the database.

This is not really great for statistics and licensing stuff.

So we should add a userTrackPurchase(userId, trackId, purchasedAtDate, purchaseType) table in which we store info about the purchase. The purchaseType property could be "stream" | "purchase" to indicate whether it was bought by having streamed x times or whether it was a straight up purchase. Just some metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant