FULLTEXT KEY for MySQL is turning to a regular Index

Description

When generating a changelog file from an existing schema a FULLTEXT key is not considered and it appears to be turned into a regular Index instead

for example, the following production table definition

CREATE TABLE `faq` (
`faq_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`question` varchar(200) NOT NULL,
`answer` text NOT NULL,
`last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`faq_id`),
FULLTEXT KEY `question_answer` (`question`,`answer`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Holds faq section''s questions and answers';

gets converted to:

<createTable tableName="faq">
<column autoIncrement="true" name="faq_id" type="TINYINT(3) UNSIGNED">
<constraints primaryKey="true"/>
</column>
<column name="question" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="answer" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column defaultValueComputed="CURRENT_TIMESTAMP" name="last_updated" type="TIMESTAMP">
<constraints nullable="false"/>
</column>
</createTable>

<createIndex indexName="question_answer" tableName="faq" unique="false">
<column name="question" type="VARCHAR(255)"/>
<column name="answer" type="VARCHAR(255)"/>
</createIndex>

While I can modify the generated SQL or XML myself to manually add the FULLTEXT key this would be greatly appreciated as a feature to liquibase enabling more users I'm sure.

Environment

Production / Dev

Activity

Show:

Gavriel Fleischer November 15, 2016 at 3:14 PM

adding modifySql worked for me on TEXT column:

<createIndex indexName="question_answer" tableName="faq" unique="false">
<column name="question" type="VARCHAR"/>
<column name="answer" type="VARCHAR"/>
</createIndex>
<modifySql>
<replace replace="INDEX" with="FULLTEXT INDEX"/>
</modifySql>

Gavriel Fleischer November 15, 2016 at 1:57 PM

what's the manual fix? how can I add FULLTEXT to the xml?

Details

Reporter

Affects versions

Priority

Created June 19, 2014 at 6:16 PM
Updated November 15, 2016 at 3:14 PM

Flag notifications