-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
664de52
commit 4884f73
Showing
11 changed files
with
186 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
database/migration/src/main/resources/changesets/enlarge_docker_hash_store_entry_id.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
|
||
<!-- BEGIN DOCKER_HASH_STORE_ENTRY_ID PK widening --> | ||
<!-- For Postgresql there are 2 changesets: one for modifying the table column type, and another one for altering the autoincrementing sequence. | ||
The other DBs can be refactored similarly with a single addAutoIncrement changeset. --> | ||
<changeSet author="sshah" id="enlarge_docker_hash_store_entry_id" dbms="mysql,hsqldb,mariadb"> | ||
<addAutoIncrement | ||
columnName="DOCKER_HASH_STORE_ENTRY_ID" | ||
columnDataType="BIGINT" | ||
incrementBy="1" | ||
tableName="DOCKER_HASH_STORE_ENTRY" | ||
/> | ||
</changeSet> | ||
|
||
<changeSet author="sshah" id="postgresql_enlarge_docker_hash_store_entry_id" dbms="postgresql"> | ||
<modifyDataType | ||
columnName="DOCKER_HASH_STORE_ENTRY_ID" | ||
tableName="DOCKER_HASH_STORE_ENTRY" | ||
newDataType="BIGINT" | ||
/> | ||
</changeSet> | ||
|
||
<changeSet author="sshah" id="postgresql_enlarge_docker_hash_store_entry_id_seq" dbms="postgresql"> | ||
<preConditions onFail="MARK_RAN"> | ||
<!-- idempotency check (noop if the sequence is present and already consistent what the alter would do) --> | ||
<sqlCheck expectedResult="0"> | ||
SELECT count(*) | ||
FROM information_schema.sequences | ||
WHERE sequence_name = 'DOCKER_HASH_STORE_ENTRY_DOCKER_HASH_STORE_ENTRY_ID_seq' | ||
AND data_type = 'bigint'; | ||
</sqlCheck> | ||
</preConditions> | ||
<sql>alter sequence "DOCKER_HASH_STORE_ENTRY_DOCKER_HASH_STORE_ENTRY_ID_seq" as bigint;</sql> | ||
</changeSet> | ||
<!-- END DOCKER_HASH_STORE_ENTRY_ID PK widening --> | ||
|
||
</databaseChangeLog> |
41 changes: 41 additions & 0 deletions
41
database/migration/src/main/resources/changesets/enlarge_sub_workflow_store_entry_id.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
|
||
<!-- BEGIN SUB_WORKFLOW_STORE_ENTRY_ID PK widening --> | ||
<!-- For Postgresql there are 2 changesets: one for modifying the table column type, and another one for altering the autoincrementing sequence. | ||
The other DBs can be refactored similarly with a single addAutoIncrement changeset. --> | ||
<changeSet author="sshah" id="enlarge_sub_workflow_store_entry_id" dbms="mysql,hsqldb,mariadb"> | ||
<addAutoIncrement | ||
columnName="SUB_WORKFLOW_STORE_ENTRY_ID" | ||
columnDataType="BIGINT" | ||
incrementBy="1" | ||
tableName="SUB_WORKFLOW_STORE_ENTRY" | ||
/> | ||
</changeSet> | ||
|
||
<changeSet author="sshah" id="postgresql_enlarge_sub_workflow_store_entry_id" dbms="postgresql"> | ||
<modifyDataType | ||
columnName="SUB_WORKFLOW_STORE_ENTRY_ID" | ||
tableName="SUB_WORKFLOW_STORE_ENTRY" | ||
newDataType="BIGINT" | ||
/> | ||
</changeSet> | ||
|
||
<changeSet author="sshah" id="postgresql_enlarge_sub_workflow_store_entry_id_seq" dbms="postgresql"> | ||
<preConditions onFail="MARK_RAN"> | ||
<!-- idempotency check (noop if the sequence is present and already consistent what the alter would do) --> | ||
<sqlCheck expectedResult="0"> | ||
SELECT count(*) | ||
FROM information_schema.sequences | ||
WHERE sequence_name = 'SUB_WORKFLOW_STORE_ENTRY_SUB_WORKFLOW_STORE_ENTRY_ID_seq' | ||
AND data_type = 'bigint'; | ||
</sqlCheck> | ||
</preConditions> | ||
<sql>alter sequence "SUB_WORKFLOW_STORE_ENTRY_SUB_WORKFLOW_STORE_ENTRY_ID_seq" as bigint;</sql> | ||
</changeSet> | ||
<!-- END SUB_WORKFLOW_STORE_ENTRY_ID PK widening --> | ||
|
||
</databaseChangeLog> |
82 changes: 82 additions & 0 deletions
82
database/migration/src/main/resources/changesets/enlarge_workflow_store_entry_id.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
|
||
<!-- Drop the foreign key constraint from SUB_WORKFLOW_STORE_ENTRY to WORKFLOW_STORE_ENTRY to allow for the latter's PK to be widened. --> | ||
<changeSet author="sshah" id="drop_sub_workflow_store_entry_root_workflow_id_fk" dbms="mysql,hsqldb,postgresql,mariadb"> | ||
<dropForeignKeyConstraint | ||
baseTableName="SUB_WORKFLOW_STORE_ENTRY" | ||
constraintName="FK_SUB_WORKFLOW_STORE_ENTRY_ROOT_WORKFLOW_ID" | ||
/> | ||
</changeSet> | ||
|
||
<!-- BEGIN WORKFLOW_STORE_ENTRY_ID PK widening --> | ||
<!-- For Postgresql there are 2 changesets: one for modifying the table column type, and another one for altering the autoincrementing sequence. | ||
The other DBs can be refactored similarly with a single addAutoIncrement changeset. --> | ||
<changeSet author="sshah" id="enlarge_workflow_store_entry_id" dbms="mysql,hsqldb,mariadb"> | ||
<addAutoIncrement | ||
columnName="WORKFLOW_STORE_ENTRY_ID" | ||
columnDataType="BIGINT" | ||
incrementBy="1" | ||
tableName="WORKFLOW_STORE_ENTRY" | ||
/> | ||
</changeSet> | ||
|
||
<changeSet author="sshah" id="postgresql_enlarge_workflow_store_entry_id" dbms="postgresql"> | ||
<modifyDataType | ||
columnName="WORKFLOW_STORE_ENTRY_ID" | ||
tableName="WORKFLOW_STORE_ENTRY" | ||
newDataType="BIGINT" | ||
/> | ||
</changeSet> | ||
|
||
<changeSet author="sshah" id="postgresql_enlarge_workflow_store_entry_id_seq" dbms="postgresql"> | ||
<preConditions onFail="MARK_RAN"> | ||
<!-- idempotency check (noop if the sequence is present and already consistent what the alter would do) --> | ||
<sqlCheck expectedResult="0"> | ||
SELECT count(*) | ||
FROM information_schema.sequences | ||
WHERE sequence_name = 'WORKFLOW_STORE_ENTRY_WORKFLOW_STORE_ENTRY_ID_seq' | ||
AND data_type = 'bigint'; | ||
</sqlCheck> | ||
</preConditions> | ||
<sql>alter sequence "WORKFLOW_STORE_ENTRY_WORKFLOW_STORE_ENTRY_ID_seq" as bigint;</sql> | ||
</changeSet> | ||
<!-- END WORKFLOW_STORE_ENTRY_ID PK widening --> | ||
|
||
<!-- BEGIN widening FK to match PK --> | ||
<changeSet author="sshah" id="enlarge_sub_workflow_store_entry_fk" dbms="mysql,hsqldb,postgresql,mariadb"> | ||
<modifyDataType | ||
tableName="SUB_WORKFLOW_STORE_ENTRY" | ||
columnName="ROOT_WORKFLOW_ID" | ||
newDataType="BIGINT" | ||
/> | ||
</changeSet> | ||
<!-- END widening FK to match PK --> | ||
|
||
<!-- MariaDB's FK NotNull constraint does not survive the widening above and must be recreated explicitly. --> | ||
<!-- BEGIN Restoring FK NotNull constraint --> | ||
<changeSet author="sshah" id="mariadb_not_null_constraint_sub_workflow_store_entry_fk" dbms="mariadb,mysql"> | ||
<addNotNullConstraint | ||
tableName="SUB_WORKFLOW_STORE_ENTRY" | ||
columnName="ROOT_WORKFLOW_ID" | ||
columnDataType="BIGINT" | ||
/> | ||
</changeSet> | ||
<!-- END Restoring FK NotNull constraint --> | ||
|
||
<!-- Restoring the FK --> | ||
<changeSet author="sshah" id="recreate_sub_workflow_store_entry_root_workflow_id_fk" dbms="mysql,hsqldb,postgresql,mariadb"> | ||
<addForeignKeyConstraint | ||
constraintName="FK_SUB_WORKFLOW_STORE_ENTRY_ROOT_WORKFLOW_ID" | ||
baseColumnNames="ROOT_WORKFLOW_ID" | ||
baseTableName="SUB_WORKFLOW_STORE_ENTRY" | ||
referencedTableName="WORKFLOW_STORE_ENTRY" | ||
referencedColumnNames="WORKFLOW_STORE_ENTRY_ID" | ||
onDelete="CASCADE" | ||
/> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters