我在一个实例上运行以下变更集,该模式完全由liquibase管理:
<changeSet author="aweigold" id="20120213-1">
<delete tableName="domain_StudyListMap"/>
<delete tableName="domain_StudyList"/>
</changeSet>
我能够验证它是否运行,并且之后没有其他变更集执行:
SELECT TOP 1 [ID]
,[AUTHOR]
,[FILENAME]
,[DATEEXECUTED]
,[ORDEREXECUTED]
,[EXECTYPE]
,[MD5SUM]
,[DESCRIPTION]
,[COMMENTS]
,[TAG]
,[LIQUIBASE]
FROM [VG3].[dbo].[DATABASECHANGELOG]
ORDER BY ORDEREXECUTED DESC
ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, EXECTYPE, MD5SUM, DESCRIPTION, COMMENTS, TAG, LIQUIBASE
20120213-1, aweigold, database/common-server_02.xml, 2012-02-14 09:58:46.700, 245, EXECUTED, 3:420703ba84d05a57da0e8afb0faa690d, Delete Data (x2), NULL, 2.0.3
(1 rows affected)
但是我的桌子仍然存在:
SELECT
name
FROM VG3.sys.tables
WHERE name = 'domain_StudyListMap' or
name = 'domain_StudyList'
name
domain_StudyList
domain_StudyListMap
(2 rows affected)
我认为在sql-server中必须存在某种约束或某些东西阻止表被删除,但是我需要一些帮助来查找我需要查找的内容,以便我可以确定需要在变更集中更改哪些内容
答案 0 :(得分:2)
delete
用于从表中删除数据。你想要的是dropTable