mysqlliquibasesqldatatypesalter-column

Same data type while using liquibase modify data type


I was wondering Is there any preconditions run by default for liquibase modifydatatype upgrade? For example if i am changing column "A" whose data type is integer in following way :

<modifyDataType
            columnName="A"
            newDataType="int"
            schemaName="public"
            tableName="person"/>

Will it check before executing that the column type is same as before?

Nothing as such is written in documentation : http://www.liquibase.org/documentation/changes/modify_data_type.html


Solution

  • I've quickly checked this code: https://github.com/liquibase/liquibase/blob/ed4bd55c36f52980a43f1ac2c7ce8f819e606e38/liquibase-core/src/main/java/liquibase/sqlgenerator/core/ModifyDataTypeGenerator.java

    https://github.com/liquibase/liquibase/blob/ed4bd55c36f52980a43f1ac2c7ce8f819e606e38/liquibase-core/src/main/java/liquibase/change/core/ModifyDataTypeChange.java

    and I don't see any preconditions here.