aboutsummaryrefslogtreecommitdiff
path: root/sqitch/revert/change_git_branches_primary_key.sql
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-08-05 20:02:06 +0100
committerChristopher Baines <mail@cbaines.net>2019-08-05 20:02:06 +0100
commitf553a7490d215edf0d093bf4b5eee6c23440e916 (patch)
tree75e83575816ce7ddf8b1cfab2b8948fcaa3628a7 /sqitch/revert/change_git_branches_primary_key.sql
parent4b59108fdd320d32378cd1f31e9f394af52122ea (diff)
downloaddata-service-f553a7490d215edf0d093bf4b5eee6c23440e916.tar
data-service-f553a7490d215edf0d093bf4b5eee6c23440e916.tar.gz
Change the git_branches table primary key
To allow for having branches in multiple git repositories.
Diffstat (limited to 'sqitch/revert/change_git_branches_primary_key.sql')
-rw-r--r--sqitch/revert/change_git_branches_primary_key.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/sqitch/revert/change_git_branches_primary_key.sql b/sqitch/revert/change_git_branches_primary_key.sql
new file mode 100644
index 0000000..9d548c3
--- /dev/null
+++ b/sqitch/revert/change_git_branches_primary_key.sql
@@ -0,0 +1,9 @@
+-- Revert guix-data-service:change_git_branches_primary_key from pg
+
+BEGIN;
+
+ALTER TABLE git_branches DROP CONSTRAINT git_branches_pkey;
+
+ALTER TABLE git_branches ADD PRIMARY KEY (name, commit);
+
+COMMIT;