]> git.ozlabs.org Git - patchwork/blobdiff - lib/sql/migration/003-add-comment-parent.sql
sql: Add uncommitted migration scripts
[patchwork] / lib / sql / migration / 003-add-comment-parent.sql
diff --git a/lib/sql/migration/003-add-comment-parent.sql b/lib/sql/migration/003-add-comment-parent.sql
new file mode 100644 (file)
index 0000000..e6f9f64
--- /dev/null
@@ -0,0 +1,7 @@
+BEGIN;
+ALTER TABLE "patchwork_comment" ADD COLUMN "parent_id" integer NULL;
+ALTER TABLE "patchwork_comment" ADD CONSTRAINT parent_id_refs_id_7b721867
+        FOREIGN KEY ("parent_id")
+        REFERENCES "patchwork_comment" ("id")
+        DEFERRABLE INITIALLY DEFERRED;
+COMMIT;