feat(db): add M2 likes schema (general_likes, _albums, _artists)
Three tables keyed on (user_id, entity_id) with liked_at. Per-table indexes on (user_id, liked_at DESC) for the recently-liked feed. sqlc queries cover like/unlike/list-rows/count/list-ids per entity.
This commit is contained in:
@@ -29,6 +29,24 @@ type Artist struct {
|
||||
UpdatedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type GeneralLike struct {
|
||||
UserID pgtype.UUID
|
||||
TrackID pgtype.UUID
|
||||
LikedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type GeneralLikesAlbum struct {
|
||||
UserID pgtype.UUID
|
||||
AlbumID pgtype.UUID
|
||||
LikedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type GeneralLikesArtist struct {
|
||||
UserID pgtype.UUID
|
||||
ArtistID pgtype.UUID
|
||||
LikedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type PlayEvent struct {
|
||||
ID pgtype.UUID
|
||||
UserID pgtype.UUID
|
||||
|
||||
Reference in New Issue
Block a user