summaryrefslogtreecommitdiffstats
path: root/lib/sql/migration/007-patch-pull-requests.sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sql/migration/007-patch-pull-requests.sql')
-rw-r--r--lib/sql/migration/007-patch-pull-requests.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sql/migration/007-patch-pull-requests.sql b/lib/sql/migration/007-patch-pull-requests.sql
new file mode 100644
index 0000000..9155133
--- /dev/null
+++ b/lib/sql/migration/007-patch-pull-requests.sql
@@ -0,0 +1,6 @@
+BEGIN;
+ALTER TABLE patchwork_patch ADD column pull_url varchar(255);
+ALTER TABLE patchwork_patch ALTER COLUMN content DROP NOT NULL;
+ALTER TABLE patchwork_patch ADD CONSTRAINT has_content_or_url
+ CHECK (pull_url IS NOT NULL OR content IS NOT NULL);
+COMMIT;