summaryrefslogtreecommitdiffstats
path: root/lib/sql/migration/004-msgid-uniqueness.sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sql/migration/004-msgid-uniqueness.sql')
-rw-r--r--lib/sql/migration/004-msgid-uniqueness.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sql/migration/004-msgid-uniqueness.sql b/lib/sql/migration/004-msgid-uniqueness.sql
new file mode 100644
index 0000000..1e8ac0b
--- /dev/null
+++ b/lib/sql/migration/004-msgid-uniqueness.sql
@@ -0,0 +1,7 @@
+BEGIN;
+ALTER TABLE patchwork_patch DROP CONSTRAINT "patchwork_patch_msgid_key";
+ALTER TABLE patchwork_comment DROP CONSTRAINT "patchwork_comment_msgid_key";
+
+ALTER TABLE patchwork_patch ADD UNIQUE ("msgid", "project_id");
+ALTER TABLE patchwork_comment ADD UNIQUE ("msgid", "patch_id");
+COMMIT;