liquibase 中的 CLOB 类型在 SQL 服务器中变为 VARCHAR
CLOB type in liquibase turns to VARCHAR in SQL Server
我的 liquibase 中有以下条目 xml:
<changeSet author="lars" id="1">
<createTable tableName="STATUS">
<column autoIncrement="true" name="AUTOID" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_STATUS"/>
</column>
...
<column name="DATA" type="CLOB(1048576)">
<constraints nullable="false"/>
</column>
<column name="VERSION" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
但是当我在 MS SQL 服务器标准版 v12 上使用 liquibase 运行 时,我看到 DATA
列已创建为类型 VARCHAR
.
我用的是liquibase maven plugin v3.2.0
我使用的驱动是com.microsoft.sqlserver.jdbc.SQLServerDriver
、sqljdbc42.jar
,即4.2版本。
有人知道为什么会这样吗?
查看 ClobType.java
class。
在方法 toDatabaseDataType
中,它有一个针对 MSSQL 数据库类型的 else if
部分:
else if (database instanceof MSSQLDatabase) {
...
我对 MS SQL 一无所知,但在我看来,liquibase(除其他外)会检查 MS SQL db 和 returns a 的版本号不同的类型取决于数据库版本。也许这更适合 MS SQL db 并且为了方便 liquibase 直接翻译它?
我的 liquibase 中有以下条目 xml:
<changeSet author="lars" id="1">
<createTable tableName="STATUS">
<column autoIncrement="true" name="AUTOID" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_STATUS"/>
</column>
...
<column name="DATA" type="CLOB(1048576)">
<constraints nullable="false"/>
</column>
<column name="VERSION" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
但是当我在 MS SQL 服务器标准版 v12 上使用 liquibase 运行 时,我看到 DATA
列已创建为类型 VARCHAR
.
我用的是liquibase maven plugin v3.2.0
我使用的驱动是com.microsoft.sqlserver.jdbc.SQLServerDriver
、sqljdbc42.jar
,即4.2版本。
有人知道为什么会这样吗?
查看 ClobType.java
class。
在方法 toDatabaseDataType
中,它有一个针对 MSSQL 数据库类型的 else if
部分:
else if (database instanceof MSSQLDatabase) {
...
我对 MS SQL 一无所知,但在我看来,liquibase(除其他外)会检查 MS SQL db 和 returns a 的版本号不同的类型取决于数据库版本。也许这更适合 MS SQL db 并且为了方便 liquibase 直接翻译它?