aboutsummaryrefslogtreecommitdiff
path: root/sqitch/deploy
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/deploy
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/deploy')
-rw-r--r--sqitch/deploy/change_git_branches_primary_key.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/sqitch/deploy/change_git_branches_primary_key.sql b/sqitch/deploy/change_git_branches_primary_key.sql
new file mode 100644
index 0000000..af0ff80
--- /dev/null
+++ b/sqitch/deploy/change_git_branches_primary_key.sql
@@ -0,0 +1,9 @@
+-- Deploy guix-data-service:change_git_branches_primary_key to pg
+
+BEGIN;
+
+ALTER TABLE git_branches DROP CONSTRAINT name_commit;
+
+ALTER TABLE git_branches ADD PRIMARY KEY (name, commit, git_repository_id);
+
+COMMIT;