Using liquibase 3.4.1 I want to rename my columns in Oracle to uppercase if they exist. I always get the following error no matter what I do:
Unexpected error running Liquibase: ORA-00957: duplicate column name
[Failed SQL: ALTER TABLE "SYSTEM"."MYTABLE" RENAME COLUMN "id" TO "ID"]
My precondition looks like this:
<changeSet author="sake" id="gfdgfd" dbms="oracle" objectQuotingStrategy="QUOTE_ALL_OBJECTS">
<preConditions onFail="MARK_RAN" >
<columnExists tableName="MYTABLE" columnName="id" />
</preConditions>
<renameColumn tableName="MYTABLE" oldColumnName="id" newColumnName="ID"/>
</changeSet>
I tried following: - removing objectQuotingStrategy - adding SQL check:
<sqlCheck expectedResult="1">
SELECT COUNT(*) FROM USER_TAB_COLUMNS
WHERE TABLE_NAME='MYTABLE'
AND COLUMN_NAME='id'
</sqlCheck>
Any idea why this happens? :/