aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/20170613221502_np.sql
blob: 76595553ab24c0c4a19cdbbe111d4b58ec21d97e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE IF NOT EXISTS now_playing (
	artist text,
	album_artist text,
	track_name text,
	album text,
	track_number int,
	duration int,
	received timestamptz DEFAULT current_timestamp,
	mbid text,
	song_id int REFERENCES songs,
	session_key text REFERENCES scrobbling_sessions,
	user_id int UNIQUE REFERENCES users
);

-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE now_playing;