-
Notifications
You must be signed in to change notification settings - Fork 160
/
databasechangelog_fields_update.xml
61 lines (50 loc) · 3.12 KB
/
databasechangelog_fields_update.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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>