Pregunta

I want to update the type of a column named "password". At the moment it has type NVARCHAR(40) and I want it to be of type NVARCHAR(64). This is what I did:

<changeSet id="1 - change password length" author="chris311">
    <update tableName="tablename">
        <column name="password" type="NVARCHAR(64)"/>
    </update>
</changeSet>

What else is there to do? Because this obviously does not change anything in the DB.

¿Fue útil?

Solución

You're using the wrong refactoring operation. Try modifyDataType

Otros consejos

<changeSet id="increase-password-length" author="martin">
  <modifyDataType tableName="tablename" columnName="password" newDataType="NVARCHAR(64)"/>
</changeSet>

You can check out http://www.liquibase.org/documentation/changes/modify_data_type.html for more documentation

Or you can do by using sql tag:

<changeSet author="liquibase-sql" id="example-sql" context="migrate">
    <sql dbms="mysql">
      ALTER TABLE tablename MODIFY COLUMN password NVARCHAR(64)
    </sql>
</changeSet>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top