3 回答

TA貢獻(xiàn)1821條經(jīng)驗(yàn) 獲得超5個(gè)贊
問(wèn)題在于on-fail屬性拼寫不正確。on-fail應(yīng)該是onFail。
最好將先決條件置于特定更改集的范圍內(nèi),并且注釋應(yīng)該在先決條件之后進(jìn)行,盡管這不是這里的問(wèn)題。
databaseChangeLog:
? - changeSet:
? ? ? id: zzchange-1.0-remove-xczczxc
? ? ? author: zzzz
? ? ? preConditions:
? ? ? ? onFail: mark_ran
? ? ? ? tableExists:
? ? ? ? ? tableName: some_old_table
? ? ? comment: Remove some_old_table table - no longer needed
? ? ? changes:
? ? ? ? - dropTable:
? ? ? ? ? ? tableName: some_old_table

TA貢獻(xiàn)1866條經(jīng)驗(yàn) 獲得超5個(gè)贊
在你的第二次嘗試中,在你的先決條件之后發(fā)表你的評(píng)論
databaseChangeLog:
? - changeSet:
? ? ? id: zzchange-1.0-remove-xczczxc
? ? ? author: zzzz
? ? ? preConditions:
? ? ? ? on-fail: mark_ran
? ? ? ? tableExists:
? ? ? ? ? tableName: some_old_table
? ? ? comment: Remove some_old_table table - no longer needed
? ? ? changes:
? ? ? ? - dropTable:
? ? ? ? ? ? tableName: some_old_table
我不太確定為什么您的第一次嘗試行不通,但是我認(rèn)為擁有全局先決條件不是一個(gè)好主意。這是因?yàn)樗麄冊(cè)谕晃臋n中所說(shuō)的:
Preconditions at the changelog level apply to all changesets, not just those listed in the current changelog or its child changelogs.

TA貢獻(xiàn)1854條經(jīng)驗(yàn) 獲得超8個(gè)贊
請(qǐng)使用以下語(yǔ)法跳過(guò)當(dāng)前表中的更改
CREATE table IF NOT EXISTS
添加回答
舉報(bào)