Open Tigrov opened 1 year ago
MSSQL is not supported CASCADE
option: https://learn.microsoft.com/sql/t-sql/statements/drop-table-transact-sql?view=sql-server-ver16
Should we throw exception when $cascade
is true in MSSQL? Or we need to use tricks, for example: https://stackoverflow.com/a/4858773?
In cases when DBMS does not support functionality we use complex queries like https://github.com/yiisoft/db-mssql/blob/eb4e5ef9eb7de1fb340b9c4bb894f921d4cad882/src/DDLQueryBuilder.php#L237
Add two options for dropping a table
IF EXISTS
- drop table only if it existsCASCADE
- drop also dependencies cascadeSuggestions for
QueryBuilderInterface::dropTable()
string $table
toarray|string $tables
and realize method for list of tables;$cascade = false
and generate SQL query to drop tables and dependencies cascade;QueryBuilderInterface::dropTableIfExists()
with the same agruments and generate SQL query withIF EXISTS
construction.