Hello,
the documentation for dropTable states that the attribute “cascadeConstraints” is supported for all DBMS.
At least for SQL Server this is not true
Consider the following changeLog:
- <?xml version="1.0" encoding="utf-8"?>
- http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.liquibase.org/xml/ns/dbchangelog">
- <constraints nullable="false"
- primaryKey="true"
- primaryKeyName="pk_bar" />
- <addForeignKeyConstraint constraintName="fk_bar_foo"
- baseTableName="foo" baseColumnNames="bar_id"
- referencedTableName="bar" referencedColumnNames="id" />
Error executing SQL DROP TABLE [dbo].[bar]: Could not drop object ‘dbo.bar’ because it is referenced by a FOREIGN KEY constraint.
To my knowledge this only works on Postgres, Oracle, DB2, H2 and HSQLDB.