]> git.ozlabs.org Git - patchwork/blobdiff - lib/sql/migration/007-patch-pull-requests.sql
Add support for git-pull requests
[patchwork] / lib / sql / migration / 007-patch-pull-requests.sql
diff --git a/lib/sql/migration/007-patch-pull-requests.sql b/lib/sql/migration/007-patch-pull-requests.sql
new file mode 100644 (file)
index 0000000..9155133
--- /dev/null
@@ -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;