We had a changeset defined in XML which worked in version 4.6.1
<changeSet author="tts" id="3-2">
<addColumn schemaName="" tableName="ITEMS">
<column name="rotationTemp" type="REAL" valueNumeric="90*rotation"/>
</addColumn>
<dropColumn columnName="rotation" tableName="ITEMS"/>
<addColumn schemaName="" tableName="ITEMS">
<column name="rotation" type="REAL" valueNumeric="rotationTemp"/>
</addColumn>
<dropColumn columnName="rotationTemp" tableName="ITEMS"/>
</changeSet>
The changeset is used to change the values in column “rotation” in SQLite, creating a new temp column, dropping the old one and recreating the column and filling it with the values from temp column. After migrating to the last verion (4.16.1 at the moment of this post) the changeset stopped working generating the following error:
liquibase.exception.DatabaseException: [SQLITE_ERROR] SQL error or missing database
(duplicate column name: rotation) [Failed SQL: (1) CREATE TABLE ITEMS (item_id INTEGER
CONSTRAINT PK_ITEMS PRIMARY KEY AUTOINCREMENT NOT NULL, x DOUBLE(2000000000, 10), y
DOUBLE(2000000000, 10), rotation FLOAT, itemslayout_id BIGINT(2000000000, 10),
intetnalId INTEGER, rotationTemp FLOAT(2000000000, 10), rotation FLOAT)]
It seems that liquibase is trying to create a new table with a duplicated “rotation” column instead of just dropping the clumn and adding it back, but the table was created in a previous changelog using :
<createTable tableName="ITEMS">
<column autoIncrement="true" name="item_id" type="INTEGER">
<constraints primaryKey="true"/>
</column>
<column name="x" type="DOUBLE(2000000000, 10) "/>
<column name="y" type="DOUBLE(2000000000, 10) "/>
<column name="rotation" type="INTEGER"/>
<column name="itemslayout_id" type="BIGINT(2000000000, 10)"/>
<column name="intetnalId" type="INTEGER"/>
</createTable>
We rolled back liquibase library progressively and we realized that the error starts from version 4.6.2 but it persists till last version. We rolled back to 4.6.1 but we are stuck to this old version and unable to update. Software is currently in production so it wuold be hard to re-write the changelog. Is there a way to avoid this error or should I report an issue on GitHub?
Bests, Dario