Skip to content

Commit 1db006e

Browse files
committed
add composite pk
1 parent 9cd5f52 commit 1db006e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

liquibase/changelog.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,6 @@
9393
<include file="changes/feat_1507.sql" relativeToChangelogFile="true"/>
9494
<!-- Added constraint on operational status -->
9595
<include file="changes/fix_operation_status_constraint.sql" relativeToChangelogFile="true"/>
96+
<!-- Remove filename as the primary key on databasechangelog table and add composite(id, author, filename) -->
97+
<include file="changes/update_liquibase_changelog.sql" relativeToChangelogFile="true"/>
9698
</databaseChangeLog>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- This script updates the databasechangelog aligning all environments with the correct primary key
2+
3+
-- Drop the existing PK if it exists
4+
ALTER TABLE databasechangelog
5+
DROP CONSTRAINT IF EXISTS databasechangelog_pkey;
6+
7+
-- Add the correct composite primary key
8+
ALTER TABLE databasechangelog
9+
ADD CONSTRAINT databasechangelog_pkey
10+
PRIMARY KEY (id, author, filename);

0 commit comments

Comments
 (0)