-
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render
if_not_exists
option for CreateTableOp, CreateIndexOp, DropT…
…ableOp and DropIndexOp Render ``if_exists`` and ``if_not_exists`` parameters in :class:`.CreateTableOp`, :class:`.CreateIndexOp`, :class:`.DropTableOp` and :class:`.DropIndexOp` in an autogenerate context. While Alembic does not set these parameters during an autogenerate run, they can be enabled using a custom :class:`.Rewriter` in the ``env.py`` file, where they will now be part of the rendered Python code in revision files. Pull request courtesy of Louis-Amaury Chaib (@lachaib). Closes: #1446 Pull-request: #1446 Pull-request-sha: 90c9735 Change-Id: I6b0a5ffaf7e2d1a0a1e1f1e80ed0ee168ae2bd09
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. change:: | ||
:tags: usecase, autogenerate | ||
|
||
Render ``if_exists`` and ``if_not_exists`` parameters in | ||
:class:`.CreateTableOp`, :class:`.CreateIndexOp`, :class:`.DropTableOp` and | ||
:class:`.DropIndexOp` in an autogenerate context. While Alembic does not | ||
set these parameters during an autogenerate run, they can be enabled using | ||
a custom :class:`.Rewriter` in the ``env.py`` file, where they will now be | ||
part of the rendered Python code in revision files. Pull request courtesy | ||
of Louis-Amaury Chaib (@lachaib). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters