Skip to content

Commit a0a439a

Browse files
committed
0.4/2015-07-07--salt_and_hash.xml: fix losing of not null setting on MySQL.
@see http://forum.liquibase.org/topic/warning-of-losing-primary-key-autoincrement-for-mysql Fix the following warning during startup: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use <sql> and re-specify all configuration if this is the case
1 parent d42874c commit a0a439a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/resources/liquibase/version/0.4/2015-07-07--salt_and_hash.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
<changeSet id="increase-length-of-hash-column-in-users-table" author="php-coder" context="scheme">
1616
<comment>Increases length of hash column in users table</comment>
1717

18-
<modifyDataType tableName="users" columnName="hash" newDataType="VARCHAR(60)" />
18+
<!--
19+
We can't use modifyDataType because it looses not null setting:
20+
http://forum.liquibase.org/topic/warning-of-losing-primary-key-autoincrement-for-mysql
21+
-->
22+
<sql>
23+
ALTER TABLE users
24+
MODIFY COLUMN hash VARCHAR(60) NOT NULL
25+
</sql>
1926

2027
</changeSet>
2128

0 commit comments

Comments
 (0)