aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/20170613212553_op-constraint.sql
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-13 21:45:15 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-13 21:45:15 -0400
commit665845a7e5050a57e6dee05a3055e2a973e1e108 (patch)
tree79fd6ef776b56fd73489deed37ccf2768f128c6f /migrations/20170613212553_op-constraint.sql
parent1d8793f4f84fd5c88dd36eedb83e0c06c24f7477 (diff)
downloadlastfm-api-665845a7e5050a57e6dee05a3055e2a973e1e108.tar.gz
Migrations
Diffstat (limited to 'migrations/20170613212553_op-constraint.sql')
-rw-r--r--migrations/20170613212553_op-constraint.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/migrations/20170613212553_op-constraint.sql b/migrations/20170613212553_op-constraint.sql
new file mode 100644
index 0000000..1ef1ec1
--- /dev/null
+++ b/migrations/20170613212553_op-constraint.sql
@@ -0,0 +1,8 @@
+
+-- +goose Up
+-- SQL in section 'Up' is executed when this migration is applied
+ALTER TABLE users ADD CONSTRAINT op UNIQUE (type, op_id);
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back
+ALTER TABLE users DROP CONSTRAINT op;