-
-
Notifications
You must be signed in to change notification settings - Fork 269
Support DROP CONSTRAINT IF EXISTS #1651
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
Support DROP CONSTRAINT IF EXISTS #1651
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 1c3c0d3 of this pull request into gerrit so we can run tests and reviews and stuff
New Gerrit review created for change 1c3c0d3: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5878 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Michael Bayer (zzzeek) wrote:
code review left on gerrit
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5878
:param if_exists: If True, adds IF EXISTS operator when | ||
dropping the constraint | ||
|
||
.. versionadded:: 1.15.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Michael Bayer (zzzeek) wrote:
1.15.3
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5878
@@ -7,7 +7,7 @@ | |||
|
|||
from . import ops | |||
from .base import Operations | |||
from ..util.sqla_compat import _copy | |||
from ..util.sqla_compat import _copy, sqla_2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Michael Bayer (zzzeek) wrote:
fix
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5878
context = op_fixture() | ||
if sqla_compat.sqla_2: | ||
op.drop_constraint("foo_bar_bat", "t1", if_exists=True) | ||
context.assert_("ALTER TABLE t1 DROP CONSTRAINT IF EXISTS foo_bar_bat") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Michael Bayer (zzzeek) wrote:
looks like >79
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5878
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5878 has been merged. Congratulations! :) |
Fixes #1650
Description
Adds support for the
IF EXISTS
clause onDROP CONSTRAINT
operationsChecklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>
in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>
in the commit messageHave a nice day!