feat: add recently played and scrobble flow
This commit is contained in:
12
internal/db/migrations/0003_play_history.sql
Normal file
12
internal/db/migrations/0003_play_history.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE IF NOT EXISTS play_history (
|
||||
id TEXT PRIMARY KEY,
|
||||
user_id TEXT NOT NULL,
|
||||
track_id TEXT NOT NULL,
|
||||
event_type TEXT NOT NULL,
|
||||
played_at TEXT NOT NULL,
|
||||
client_name TEXT,
|
||||
submission INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_play_history_user_played_at ON play_history(user_id, played_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_play_history_track_played_at ON play_history(track_id, played_at DESC);
|
||||
Reference in New Issue
Block a user