aboutsummaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-14 00:45:42 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-14 00:57:04 -0400
commit060b315f74f437fe36175c4ddb52379d29808d64 (patch)
treef3e0bd83433f3d918927771e60a9369fbcc320a2 /migrations
parent2e190b1af96b0836684339bfb4353a17cf28f0b9 (diff)
downloadlastfm-api-060b315f74f437fe36175c4ddb52379d29808d64.tar.gz
Now Playing feature
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20170613221502_np.sql21
1 files changed, 21 insertions, 0 deletions
diff --git a/migrations/20170613221502_np.sql b/migrations/20170613221502_np.sql
new file mode 100644
index 0000000..7659555
--- /dev/null
+++ b/migrations/20170613221502_np.sql
@@ -0,0 +1,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;
+