aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/20170613212553_op-constraint.sql
diff options
context:
space:
mode:
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;