aboutsummaryrefslogtreecommitdiffstats
path: root/migration.sql
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2016-11-19 17:35:07 -0500
committerThibaut Horel <thibaut.horel@gmail.com>2016-11-19 17:35:07 -0500
commitc2c39cc2756230c1de29d8065b8b320f2f084045 (patch)
treebaf3569f25b0fabeb93144d636bf61a2deae6b4a /migration.sql
downloadlastfm-api-c2c39cc2756230c1de29d8065b8b320f2f084045.tar.gz
Initial commit
Diffstat (limited to 'migration.sql')
-rw-r--r--migration.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/migration.sql b/migration.sql
new file mode 100644
index 0000000..cd95209
--- /dev/null
+++ b/migration.sql
@@ -0,0 +1,17 @@
+BEGIN;
+
+ CREATE TABLE new_sessions (
+ user string,
+ key string PRIMARY KEY,
+ client string,
+ protocol string,
+ created int
+ );
+
+ INSERT INTO new_sessions SELECT * FROM sessions;
+
+ DROP TABLE sessions;
+
+ ALTER TABLE new_sessions RENAME TO sessions;
+
+END;