-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3926 from Agnul97/fix-databasechangelogIdTooSmall
FIX - introduced new changeset to update databasechangelog
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
commons/src/main/resources/liquibase/2.0.0/databasechangelog_fields_update.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,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2019, 2022 Eurotech and/or its affiliates and others | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
Eurotech - initial API and implementation | ||
--> | ||
<databaseChangeLog | ||
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.0.xsd" | ||
logicalFilePath="KapuaDB/databasechangelog_fields_update.xml"> | ||
|
||
<!-- This changesets maintains aligned the schema of the "databasechangelog" table between different liquibase versions, upgrading the important fields that could cause problems in liquibase updates --> | ||
<!-- This is needed because liquibase doesn't automatically update schema when the specification of "databasechangelog" table changes (as happened, for example, between the 3.0.5 version and 3.6.7) --> | ||
|
||
<include relativeToChangelogFile="true" file="../common-properties.xml"/> | ||
|
||
<changeSet id="databasechangelog_removePrimaryKeyConstraint" author="eurotech"> <!-- recent versions removed primary key constraint between <id, author, filename> fields, see https://forum.liquibase.org/t/length-of-id-column-for-databasechangeloglog/1274 regarding old limit on 63 chars. Maybe this changeset could be deleted but maintained to avoid problems--> | ||
<preConditions onFail="MARK_RAN"> | ||
<primaryKeyExists tableName="databasechangelog" primaryKeyName="pk_databasechangelog"/> | ||
</preConditions> | ||
<dropPrimaryKey tableName="databasechangelog" constraintName="pk_databasechangelog"/> | ||
</changeSet> | ||
|
||
<changeSet id="databasechangelog_fields-update-id" author="eurotech"> | ||
<modifyDataType | ||
columnName="id" | ||
newDataType="varchar(255)" | ||
tableName="databasechangelog"/> | ||
</changeSet> | ||
|
||
<changeSet id="databasechangelog_fields-update-id-notnull" author="eurotech" dbms="mariadb"> <!--this changeset is needed because for mysql/mariadb you loose not null constraint with previous changeset --> | ||
<addNotNullConstraint | ||
columnName="id" | ||
columnDataType="varchar(255)" | ||
tableName="databasechangelog"/> | ||
</changeSet> | ||
|
||
<changeSet id="databasechangelog_fields-update-filename" author="eurotech"> | ||
<modifyDataType | ||
columnName="filename" | ||
newDataType="varchar(255)" | ||
tableName="databasechangelog"/> | ||
</changeSet> | ||
|
||
<changeSet id="databasechangelog_fields-update-filename-notnull" author="eurotech" dbms="mariadb"> <!--this changeset is needed because for mysql/mariadb you loose not null constraint with previous changeset --> | ||
<addNotNullConstraint | ||
columnName="filename" | ||
columnDataType="varchar(255)" | ||
tableName="databasechangelog"/> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
21 changes: 21 additions & 0 deletions
21
...ons/src/main/resources/liquibase/changelog-databasechangelog-fields-update-master.pre.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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
Eurotech - initial API and implementation | ||
--> | ||
<databaseChangeLog 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.0.xsd"> | ||
|
||
<include relativeToChangelogFile="true" file="./2.0.0/databasechangelog_fields_update.xml"/> | ||
|
||
</databaseChangeLog> |