2013-04-24 46 views
0

我想修改數據類型上的一些列從int使用爲bigint:modifyDataType在Liquibase針對SQL Server

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

當我已經定義LongType是:

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

我在Liquibase JIRA(https://liquibase.jira.com/browse/CORE-1062)中注意到,2011年有一個與PK和FK有關的已知問題需要刪除。丟棄和重新創建密鑰對我來說不是一個真正的選擇。

我得到的錯誤是:

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柱[ID] BIGINT:對象 'PK_Access_History' 依賴於列 'ID'

我想知道是否有人解決此得到了什麼?在此先感謝

回答

1

我不敢說目前沒有辦法做到這一點,除非你放棄PK約束。看起來您正在討論的錯誤雖然計劃在liquibase的第3版中修復,但是此版本沒有發佈日期。

對不起!

由於Liquibase是開源的,你可以隨時修復這個bug。 :)