aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/20170617130303_import.sql
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-18 18:18:36 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-18 18:18:36 -0400
commitff81576e21f5b89cbf47856c520df3e5e0c9adbe (patch)
treee8ba2da8eaec54a203461a0db8e05a3a3e698a11 /migrations/20170617130303_import.sql
parent858de1edf50cc1128f6b621a5413b2975ca446eb (diff)
downloadlastfm-api-ff81576e21f5b89cbf47856c520df3e5e0c9adbe.tar.gz
Import listens from lastfm
Diffstat (limited to 'migrations/20170617130303_import.sql')
-rw-r--r--migrations/20170617130303_import.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/migrations/20170617130303_import.sql b/migrations/20170617130303_import.sql
new file mode 100644
index 0000000..d897366
--- /dev/null
+++ b/migrations/20170617130303_import.sql
@@ -0,0 +1,19 @@
+
+-- +goose Up
+-- SQL in section 'Up' is executed when this migration is applied
+
+CREATE TABLE IF NOT EXISTS scrobble_import (
+ lfm_name text,
+ "from" timestamptz,
+ "to" timestamptz,
+ last_fetch timestamptz,
+ done bool,
+ PRIMARY KEY (lfm_name, "from", "to")
+);
+
+CREATE INDEX scrobbles_time ON scrobbles(time DESC);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+DROP TABLE scrobble_import;
+DROP INDEX scrobbles_time;