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

auto-update some computed fields in DB #66

Open
Sheraff opened this issue May 3, 2023 · 0 comments
Open

auto-update some computed fields in DB #66

Sheraff opened this issue May 3, 2023 · 0 comments

Comments

@Sheraff
Copy link
Owner

Sheraff commented May 3, 2023

For example, for the "likes counter" that are owned as a boolean by Track, but also incremented as a number for Album and Artist

  • we could look into postgre trigger to automate this increment
  • we could look into prisma "middleware"

If that works fine, we could also look into have similar fields on Genre, to avoid the complicated requests we have to make at query time

  • likes
  • listens
  • has tracks (in itself or its children)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant