1

I am trying to modify the data type on a number of columns from int to bigint using:

<modifyDataType tableName="ACCESS_HISTORY" columnName="ID" newDataType="${LongType}"/>

Where I have defined LongType to be:

<property name="LongType" value="bigint" dbms="mssql"/>

I noticed in the Liquibase JIRA (https://liquibase.jira.com/browse/CORE-1062) that there is a known issue from 2011 relating to the PKs and FKs that need to be dropped. Dropping and re-creating the keys isn't really an option for me.

The error I got was:

liquibase.exception.MigrationFailedExc
eption: Migration failed for change set ChangeColumnTypes.xml::4-4-060
-2::thof:
     Reason: liquibase.exception.DatabaseException: Error executing SQL ALTER TA
BLE [dbo].[ACCESS_HISTORY] ALTER COLUMN [ID] BIGINT: The object 'PK_Access_Histo
ry' is dependent on column 'ID'.:
          Caused By: Error executing SQL ALTER TABLE [dbo].[ACCESS_HISTORY] ALTE

R COLUMN [ID] BIGINT: The object 'PK_Access_History' is dependent on column 'ID'

I was wondering if anyone had got around this? Thanks in advance

4

1 回答 1

1

恐怕除非你放弃 PK 约束,否则目前没有办法做到这一点。看起来您正在谈论的错误虽然计划在 liquibase 的第 3 版中修复,但是此版本没有发布日期。

对不起!

由于 Liquibase 是开源的,您始终可以自己修复错误。:)

于 2013-04-24T13:38:37.790 回答