-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support if_exists / if_not_exists on drop_table and create_table operations #1520
Comments
Hi, I was convinced it was already supported, but it seems not. A PR with an initial implementation would be appreciated! |
@CaselIT - do you know when we could expect this to get merged and released? |
sorry, been on holiday this past week. Will try taking a look in the weekend |
Aaron Griffin has proposed a fix for this issue in the main branch: Support if_exists and if_not_exists on create/drop table commands https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5455 |
#1434 was a duplicate of this issue |
Describe the use case
This is similar to #524, which appears to at least be implemented for indexes.
SqlAlchemy already supports these operations on
DropTable
andCreateTable
so this would essentially be a pass-through in a similar manner.Databases / Backends / Drivers targeted
Postgresql
Example Use
Much like drop_index, I'd expect
to produce
Additional context
This is just some insurance for edge cases where a migration partially applies due to external circumstances. i.e. a migration containing two drop_table operations could fail after the first succeeds, but then would require some surgery to work again
Have a nice day!
The text was updated successfully, but these errors were encountered: