-
-
Notifications
You must be signed in to change notification settings - Fork 253
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 if_exists and if_not_exists on create/drop table commands #1521
Conversation
alembic/operations/base.py
Outdated
:param if_not_exists: If True, adds IF NOT EXISTS operator when | ||
creating the table. | ||
|
||
.. versionadded:: 1.13.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.
Not really sure if this is the correct next version. Happy to change it.
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.
it would be 1.13.3 since it's yet to be released
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.
great work. It's just missing a changelog: see example in https://github.com/sqlalchemy/alembic/tree/main/docs/build/unreleased
Feel free to add something like "pull request courtesy of "
sorry for the delay in the review
alembic/operations/base.py
Outdated
:param if_not_exists: If True, adds IF NOT EXISTS operator when | ||
creating the table. | ||
|
||
.. versionadded:: 1.13.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.
it would be 1.13.3 since it's yet to be released
Hello, My 2 cents on this PR, which I'm looking forward, is that it's missing the same thing I'm trying to fix with #1446 : we should have a small addition in Thanks a lot for this pull request |
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 88c7b3f of this pull request into gerrit so we can run tests and reviews and stuff
New Gerrit review created for change 88c7b3f: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
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.
the tools/write_pyi.py script needs to be run here to generate appropriate stub files
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 1063a5a of this pull request into gerrit so we can run tests and reviews and stuff
Patchset 1063a5a added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
hi - still some failures here you may need to add skip markers to these tests for SQLAlchemy < 1.4 |
TY, I missed that tests still run for sqlalchemy 1.3 - should be updated now |
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 747ae3f of this pull request into gerrit so we can run tests and reviews and stuff
Patchset 747ae3f added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
Michael Bayer (zzzeek) wrote: recheck View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
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/+/5455
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 ab4e7d4 of this pull request into gerrit so we can run tests and reviews and stuff
Patchset ab4e7d4 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
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 469be01 of this pull request into gerrit so we can run tests and reviews and stuff
Patchset 469be01 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
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/+/5455
- tox.ini (line 8): Done
Federico Caselli (CaselIT) wrote: Great work! View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
FYI I think @zzzeek might need to approve as well on account of the requested changes... but I also have no idea how Github and Gerrit interact with each other :) |
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 has been merged. Congratulations! :) |
Fixes: #1520
Description
Adds if_exists/if_not_exists support to table commands, mirroring closely the same logic for indexes.
Checklist
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!