Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: EXPOSED-161 SQL Server syntax incorrectly allows CASCADE with dropSchema #1850

Merged
merged 3 commits into from
Sep 6, 2023

Conversation

bog-walk
Copy link
Member

When SchemaUtils.dropSchema(schema, cascade = true) is used with SQL Server it fails with the error:

Incorrect syntax near the keyword 'CASCADE'..
Statement(s): DROP SCHEMA TEST_SCHEMA CASCADE

Documentation shows that CASCADE is not supported in this statement (from version 2016 upwards).
In fact, other uses of dropSchema() with cascade make sure to exclude SQL Server:

@bog-walk bog-walk requested review from e5l and joc-a August 31, 2023 02:15
…opSchema

Using dropSchema() with cascade set to true in SQL Server throws a syntax excep>
because cascade is not supported.

Edit syntax to remove cascade.
Add unit test.
…opSchema

Add KDocs comment about cascade flag
@bog-walk bog-walk force-pushed the bog-walk/fix-sqlserver-drop-cascade branch from d2afc1f to e05d1a0 Compare September 6, 2023 10:57
@bog-walk bog-walk merged commit 4b5b04a into main Sep 6, 2023
3 checks passed
@bog-walk bog-walk deleted the bog-walk/fix-sqlserver-drop-cascade branch September 6, 2023 13:25
saral pushed a commit to saral/Exposed that referenced this pull request Oct 3, 2023
…opSchema (JetBrains#1850)

* fix: EXPOSED-161 SQL Server syntax incorrectly allows CASCADE with dropSchema

Using dropSchema() with cascade set to true in SQL Server throws a syntax exception
because cascade is not supported.

Edit syntax to remove cascade.
Add unit test.

Add KDocs comment about cascade flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants