aboutsummaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-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;