Remove unnecessary db search for scrobbles

I forgot I made scrobbles owned by their respective songs/albums/artists, so I can just query that instead
This commit is contained in:
mitteneer 2025-03-28 13:09:51 -04:00
parent e22dc4c949
commit cf84b4afdd
6 changed files with 22 additions and 18 deletions

View file

@ -115,7 +115,7 @@ pub const Scrobble = jetquery.Model(
struct {
id: i32,
song_id: i32,
album_id: ?i32,
album_id: i32,
date: jetquery.DateTime,
created_at: jetquery.DateTime,
updated_at: jetquery.DateTime,

View file

@ -8,7 +8,7 @@ pub fn up(repo: anytype) !void {
&.{
t.primaryKey("id", .{}),
t.column("song_id", .integer, .{}),
t.column("album_id", .integer, .{ .optional = true }),
t.column("album_id", .integer, .{}),
t.column("date", .datetime, .{}),
t.timestamps(.{}),
},