Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #756 from zanata/mariadb-fix
Browse files Browse the repository at this point in the history
rhbz1048293 Fix liquibase changeset to be compatible with mysql/mariadb version > 5.5
  • Loading branch information
Alex Eng committed Apr 13, 2015
2 parents 80d4059 + 26bf0a4 commit 4e098e3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
8 changes: 7 additions & 1 deletion functional-test/pom.xml
Expand Up @@ -36,6 +36,12 @@
<ds.connection.url>jdbc:mysql://localhost:${mysql.port}/${ds.database}?characterEncoding=UTF-8</ds.connection.url>
<ds.driver.class>com.mysql.jdbc.Driver</ds.driver.class>

<!-- mysql-dist 5.5.34 is the default version, but 5.6.14 may also work.
mysql-dist 5.6.21 won't work due to
https://github.com/jcabi/jcabi-mysql-maven-plugin/issues/47
-->
<mysql.dist.version>5.5.34</mysql.dist.version>

<!-- target zanata instance will be built by war overlay -->
<zanata.test.war.name>zanata-test-${project.version}</zanata.test.war.name>
<zanata.instance.url>http://${cargo.host}:${cargo.servlet.port}/${context.path}/</zanata.instance.url>
Expand Down Expand Up @@ -477,7 +483,7 @@
<artifactItem>
<groupId>com.jcabi</groupId>
<artifactId>mysql-dist</artifactId>
<version>5.5.34</version>
<version>${mysql.dist.version}</version>
<classifier>${mysql.classifier}</classifier>
<type>zip</type>
<overWrite>false</overWrite>
Expand Down
26 changes: 21 additions & 5 deletions zanata-war/src/main/resources/db/changelogs/db.changelog-1.5.xml
Expand Up @@ -132,22 +132,38 @@
<column name="sourceRef" type="longtext"/>
</addColumn>
</changeSet>

<changeSet author="aeng@redhat.com" id="8" dbms="mysql">

<changeSet author="aeng@redhat.com" id="8" dbms="mysql">
<!-- old checksum (without dropping/creating FKs) -->
<validCheckSum>7:1d46e83838884b75859df2299905d8a0</validCheckSum>
<!-- new checksum (with dropping/creating FKs) -->
<validCheckSum>7:d67a05b8803bac708c7df58d7153bb0e</validCheckSum>
<comment>Alter glossary tables - remove sourceRef/add auto increment</comment>

<dropColumn tableName="HGlossaryTerm" columnName="sourceRef" />


<!--
MySQL/MariaDB 5.6 or later can't change a column to autoincrement
unless constraints are removed first:
-->
<dropForeignKeyConstraint baseTableName="HGlossaryTerm" constraintName="UKglossaryterm_glossary_entry_id" />
<dropForeignKeyConstraint baseTableName="HTermComment" constraintName="UKtermComment_glossaryTerm" />
<addAutoIncrement tableName="HGlossaryEntry" columnName="id" columnDataType="bigint"/>
<addAutoIncrement tableName="HGlossaryTerm" columnName="id" columnDataType="bigint"/>
<addAutoIncrement tableName="HTermComment" columnName="id" columnDataType="bigint"/>
<addForeignKeyConstraint baseTableName="HGlossaryTerm"
baseColumnNames="glossaryEntryId" constraintName="UKglossaryterm_glossary_entry_id"
referencedTableName="HGlossaryEntry" referencedColumnNames="id" />
<addForeignKeyConstraint baseTableName="HTermComment"
baseColumnNames="glossaryTermId" constraintName="UKtermComment_glossaryTerm"
referencedTableName="HGlossaryTerm" referencedColumnNames="id" />
</changeSet>

<changeSet author="aeng@redhat.com" id="8.5" dbms="h2">
<comment>Alter glossary tables - remove sourceRef/add auto increment</comment>
<dropColumn tableName="HGlossaryTerm" columnName="sourceRef" />
</changeSet>

<changeSet author="aeng@redhat.com" id="9">
<comment>Alter glossary term table - remove constraint</comment>
<dropForeignKeyConstraint baseTableName="HTermComment" constraintName="UKtermComment_glossaryTerm" />
Expand Down

0 comments on commit 4e098e3

Please sign in to comment.