Created
February 29, 2016 16:05
-
-
Save cherniag/f7112ce712d6fca70234 to your computer and use it in GitHub Desktop.
liquibase mysql add index on text field
This file contains hidden or 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
An index for a MySQL CLOB column cannot be created with Liquibase createIndex at the moment, | |
since MySQL requires a length limit for this index, see http://dev.mysql.com/doc/refman/5.5/en/create-index.html | |
As a workaround, you can use the modifySql to 'fix' the sql generated like so: | |
<createIndex tableName="foo" indexName="i_foo"> | |
<column name="myClobColumn"/> | |
</createIndex> | |
<modifySql dbms="mysql"> | |
<replace replace="myClobColumn" with="myClobColumn(80)"/> | |
</modifySql> | |
when I use modifySql, I always put it and the command being modified in their own changeSet. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment