My Environment:
- java: 1.8.0_20, 64 bit
- liquibase: 3.3.1
- mysql: 5.5.34
- mysql connector: mysql-connector-java-5.1.34-bin.jar
- mysql driver: com.mysql.jdbc.Driver
- mysql connection string: jdbc:mysql://localhost/my_db
- mysql user: root user
- os: windows 7 64
database change log xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
<changeSet author="jbenton" id="create my_test_tbl table">
<sql> SET storage_engine=MYISAM; </sql>
<createTable tableName="my_test_tbl">
<column autoIncrement="true" name="my_test_tbl_id" type="INT UNSIGNED">
<constraints primaryKey="true"/>
</column>
<column defaultValueNumeric="0" name="col_smallint" type="SMALLINT">
<constraints nullable="false"/>
</column>
<column defaultValueNumeric="0" name="col_smallint_unsigned" type="SMALLINT UNSIGNED"/>
<column defaultValueNumeric="0" name="col_smallint_unsigned_not_null" type="SMALLINT UNSIGNED">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>
Using the updateSql
command, I see the following sql being generated
CREATE TABLE my_db.my_test_tbl (
my_test_tbl_id INT AUTO_INCREMENT NOT NULL,
col_smallint SMALLINT DEFAULT 0 NOT NULL,
col_smallint_unsigned SMALLINT DEFAULT 0 NULL,
col_smallint_unsigned_not_null SMALLINT DEFAULT 0 NOT NULL,
CONSTRAINT PK_MY_TEST_TBL PRIMARY KEY (my_test_tbl_id));
My goal is that the columns would be SMALLINT UNSIGNED
. Is there something that I am doing wrong?
/always smallint regardless of parameters passed
on theSmallIntType.java
class. I don't oversee the whole code and therefore can't say for sure if this really indicates that further parameters to the type (like "unsigned") are left out. Maybe you can file a bug/enhancement on liquibase-github for this? – Jenstype="BIGINT UNSIGNED"
even for that also its created justBIGINT(20)
not unsigned – arulraj.net