alembic 1.13.1__tar.gz → 1.13.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. {alembic-1.13.1 → alembic-1.13.3}/LICENSE +2 -2
  2. {alembic-1.13.1 → alembic-1.13.3}/PKG-INFO +1 -1
  3. {alembic-1.13.1 → alembic-1.13.3}/alembic/__init__.py +1 -1
  4. {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/api.py +3 -3
  5. {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/compare.py +1 -1
  6. {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/render.py +36 -15
  7. {alembic-1.13.1 → alembic-1.13.3}/alembic/command.py +24 -15
  8. {alembic-1.13.1 → alembic-1.13.3}/alembic/config.py +5 -10
  9. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/_autogen.py +15 -11
  10. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/base.py +5 -4
  11. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/impl.py +26 -21
  12. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/mysql.py +49 -31
  13. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/oracle.py +5 -3
  14. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/postgresql.py +2 -1
  15. {alembic-1.13.1 → alembic-1.13.3}/alembic/op.pyi +19 -2
  16. {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/base.py +24 -10
  17. {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/ops.py +21 -7
  18. {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/schemaobj.py +6 -4
  19. {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/toimpl.py +14 -2
  20. {alembic-1.13.1 → alembic-1.13.3}/alembic/runtime/environment.py +5 -7
  21. {alembic-1.13.1 → alembic-1.13.3}/alembic/runtime/migration.py +9 -9
  22. {alembic-1.13.1 → alembic-1.13.3}/alembic/script/base.py +17 -11
  23. {alembic-1.13.1 → alembic-1.13.3}/alembic/script/revision.py +25 -18
  24. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/alembic.ini.mako +4 -3
  25. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/alembic.ini.mako +3 -2
  26. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/alembic.ini.mako +3 -2
  27. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/assertions.py +13 -4
  28. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/fixtures.py +20 -8
  29. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_computed.py +1 -0
  30. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_environment.py +3 -3
  31. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/langhelpers.py +3 -6
  32. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/messaging.py +9 -3
  33. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/sqla_compat.py +3 -5
  34. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/PKG-INFO +1 -1
  35. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/SOURCES.txt +36 -35
  36. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/autogenerate.rst +8 -0
  37. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/changelog.rst +87 -0
  38. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/cookbook.rst +36 -17
  39. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/front.rst +1 -1
  40. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/tutorial.rst +1 -0
  41. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/basic.css +2 -2
  42. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/doctools.js +1 -1
  43. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/documentation_options.js +2 -2
  44. alembic-1.13.3/docs/_static/images/logo_colab.png +0 -0
  45. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/language_data.js +2 -2
  46. alembic-1.13.3/docs/_static/pygments.css +152 -0
  47. alembic-1.13.3/docs/_static/sbt-webpack-macros.html +11 -0
  48. alembic-1.13.3/docs/_static/scripts/bootstrap.js +3 -0
  49. alembic-1.13.3/docs/_static/scripts/bootstrap.js.LICENSE.txt +5 -0
  50. alembic-1.13.3/docs/_static/scripts/pydata-sphinx-theme.js +2 -0
  51. alembic-1.13.3/docs/_static/scripts/sphinx-book-theme.js +2 -0
  52. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/searchtools.js +108 -62
  53. alembic-1.13.3/docs/_static/styles/bootstrap.css +6 -0
  54. alembic-1.13.3/docs/_static/styles/pydata-sphinx-theme.css +2 -0
  55. alembic-1.13.3/docs/_static/styles/sphinx-book-theme.css +9 -0
  56. alembic-1.13.3/docs/_static/styles/theme.css +2 -0
  57. alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/LICENSE.txt +165 -0
  58. alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/css/all.min.css +5 -0
  59. alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/js/all.min.js +2 -0
  60. alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/js/all.min.js.LICENSE.txt +5 -0
  61. alembic-1.13.3/docs/_static/webpack-macros.html +31 -0
  62. {alembic-1.13.1 → alembic-1.13.3}/docs/api/autogenerate.html +530 -142
  63. {alembic-1.13.1 → alembic-1.13.3}/docs/api/commands.html +502 -133
  64. {alembic-1.13.1 → alembic-1.13.3}/docs/api/config.html +487 -121
  65. {alembic-1.13.1 → alembic-1.13.3}/docs/api/ddl.html +923 -397
  66. {alembic-1.13.1 → alembic-1.13.3}/docs/api/index.html +416 -80
  67. {alembic-1.13.1 → alembic-1.13.3}/docs/api/operations.html +669 -217
  68. alembic-1.13.3/docs/api/overview.html +497 -0
  69. {alembic-1.13.1 → alembic-1.13.3}/docs/api/runtime.html +538 -151
  70. {alembic-1.13.1 → alembic-1.13.3}/docs/api/script.html +590 -183
  71. {alembic-1.13.1 → alembic-1.13.3}/docs/autogenerate.html +499 -119
  72. {alembic-1.13.1 → alembic-1.13.3}/docs/batch.html +466 -105
  73. {alembic-1.13.1 → alembic-1.13.3}/docs/branches.html +474 -109
  74. {alembic-1.13.1 → alembic-1.13.3}/docs/build/Makefile +1 -1
  75. alembic-1.13.1/docs/_sources/autogenerate.rst.txt → alembic-1.13.3/docs/build/autogenerate.rst +8 -0
  76. alembic-1.13.1/docs/_sources/changelog.rst.txt → alembic-1.13.3/docs/build/changelog.rst +87 -0
  77. {alembic-1.13.1 → alembic-1.13.3}/docs/build/conf.py +31 -10
  78. alembic-1.13.1/docs/_sources/cookbook.rst.txt → alembic-1.13.3/docs/build/cookbook.rst +36 -17
  79. alembic-1.13.1/docs/_sources/front.rst.txt → alembic-1.13.3/docs/build/front.rst +1 -1
  80. {alembic-1.13.1 → alembic-1.13.3}/docs/build/requirements.txt +3 -0
  81. alembic-1.13.1/docs/_sources/tutorial.rst.txt → alembic-1.13.3/docs/build/tutorial.rst +1 -0
  82. {alembic-1.13.1 → alembic-1.13.3}/docs/changelog.html +1725 -715
  83. {alembic-1.13.1 → alembic-1.13.3}/docs/cookbook.html +549 -152
  84. alembic-1.13.3/docs/front.html +583 -0
  85. {alembic-1.13.1 → alembic-1.13.3}/docs/genindex.html +373 -65
  86. {alembic-1.13.1 → alembic-1.13.3}/docs/index.html +445 -80
  87. {alembic-1.13.1 → alembic-1.13.3}/docs/naming.html +443 -91
  88. {alembic-1.13.1 → alembic-1.13.3}/docs/offline.html +446 -93
  89. {alembic-1.13.1 → alembic-1.13.3}/docs/ops.html +590 -178
  90. alembic-1.13.3/docs/py-modindex.html +475 -0
  91. alembic-1.13.3/docs/search.html +392 -0
  92. alembic-1.13.3/docs/searchindex.js +1 -0
  93. {alembic-1.13.1 → alembic-1.13.3}/docs/tutorial.html +478 -113
  94. {alembic-1.13.1 → alembic-1.13.3}/pyproject.toml +11 -1
  95. {alembic-1.13.1 → alembic-1.13.3}/setup.cfg +2 -10
  96. {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_diffs.py +1 -98
  97. {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_indexes.py +5 -4
  98. {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_render.py +62 -1
  99. {alembic-1.13.1 → alembic-1.13.3}/tests/test_batch.py +14 -12
  100. {alembic-1.13.1 → alembic-1.13.3}/tests/test_command.py +7 -14
  101. {alembic-1.13.1 → alembic-1.13.3}/tests/test_config.py +9 -2
  102. {alembic-1.13.1 → alembic-1.13.3}/tests/test_impl.py +27 -0
  103. alembic-1.13.3/tests/test_messaging.py +30 -0
  104. {alembic-1.13.1 → alembic-1.13.3}/tests/test_mssql.py +4 -3
  105. {alembic-1.13.1 → alembic-1.13.3}/tests/test_op.py +20 -0
  106. {alembic-1.13.1 → alembic-1.13.3}/tests/test_postgresql.py +28 -16
  107. {alembic-1.13.1 → alembic-1.13.3}/tests/test_script_production.py +1 -1
  108. {alembic-1.13.1 → alembic-1.13.3}/tests/test_version_traversal.py +0 -2
  109. {alembic-1.13.1 → alembic-1.13.3}/tox.ini +4 -4
  110. alembic-1.13.1/.coveragerc +0 -5
  111. alembic-1.13.1/.github/FUNDING.yml +0 -6
  112. alembic-1.13.1/.github/ISSUE_TEMPLATE/bug_report.md +0 -41
  113. alembic-1.13.1/.github/ISSUE_TEMPLATE/config.yml +0 -15
  114. alembic-1.13.1/.github/ISSUE_TEMPLATE/use_case.md +0 -24
  115. alembic-1.13.1/.github/pull_request_template.md +0 -27
  116. alembic-1.13.1/.github/workflows/run-on-pr.yaml +0 -85
  117. alembic-1.13.1/.github/workflows/run-test.yaml +0 -100
  118. alembic-1.13.1/.gitignore +0 -24
  119. alembic-1.13.1/.gitreview +0 -6
  120. alembic-1.13.1/.pre-commit-config.yaml +0 -31
  121. alembic-1.13.1/docs/_static/nature.css +0 -252
  122. alembic-1.13.1/docs/_static/pygments.css +0 -75
  123. alembic-1.13.1/docs/api/overview.html +0 -163
  124. alembic-1.13.1/docs/build/assets/api_overview.graffle +0 -2795
  125. alembic-1.13.1/docs/build/make.bat +0 -113
  126. alembic-1.13.1/docs/front.html +0 -225
  127. alembic-1.13.1/docs/py-modindex.html +0 -181
  128. alembic-1.13.1/docs/search.html +0 -105
  129. alembic-1.13.1/docs/searchindex.js +0 -1
  130. alembic-1.13.1/reap_dbs.py +0 -25
  131. {alembic-1.13.1 → alembic-1.13.3}/CHANGES +0 -0
  132. {alembic-1.13.1 → alembic-1.13.3}/MANIFEST.in +0 -0
  133. {alembic-1.13.1 → alembic-1.13.3}/README.rst +0 -0
  134. {alembic-1.13.1 → alembic-1.13.3}/README.unittests.rst +0 -0
  135. {alembic-1.13.1 → alembic-1.13.3}/alembic/__main__.py +0 -0
  136. {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/__init__.py +0 -0
  137. {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/rewriter.py +0 -0
  138. {alembic-1.13.1 → alembic-1.13.3}/alembic/context.py +0 -0
  139. {alembic-1.13.1 → alembic-1.13.3}/alembic/context.pyi +0 -0
  140. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/__init__.py +0 -0
  141. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/mssql.py +0 -0
  142. {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/sqlite.py +0 -0
  143. {alembic-1.13.1 → alembic-1.13.3}/alembic/environment.py +0 -0
  144. {alembic-1.13.1 → alembic-1.13.3}/alembic/migration.py +0 -0
  145. {alembic-1.13.1 → alembic-1.13.3}/alembic/op.py +0 -0
  146. {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/__init__.py +0 -0
  147. {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/batch.py +0 -0
  148. {alembic-1.13.1 → alembic-1.13.3}/alembic/py.typed +0 -0
  149. {alembic-1.13.1 → alembic-1.13.3}/alembic/runtime/__init__.py +0 -0
  150. {alembic-1.13.1 → alembic-1.13.3}/alembic/script/__init__.py +0 -0
  151. {alembic-1.13.1 → alembic-1.13.3}/alembic/script/write_hooks.py +0 -0
  152. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/README +0 -0
  153. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/env.py +0 -0
  154. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/script.py.mako +0 -0
  155. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/README +0 -0
  156. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/env.py +0 -0
  157. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/script.py.mako +0 -0
  158. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/README +0 -0
  159. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/env.py +0 -0
  160. {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/script.py.mako +0 -0
  161. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/__init__.py +0 -0
  162. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/env.py +0 -0
  163. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/plugin/__init__.py +0 -0
  164. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/plugin/bootstrap.py +0 -0
  165. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/requirements.py +0 -0
  166. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/schemacompare.py +0 -0
  167. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/__init__.py +0 -0
  168. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/_autogen_fixtures.py +0 -0
  169. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_comments.py +0 -0
  170. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_diffs.py +0 -0
  171. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_fks.py +0 -0
  172. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_identity.py +0 -0
  173. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_op.py +0 -0
  174. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/util.py +0 -0
  175. {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/warnings.py +0 -0
  176. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/__init__.py +0 -0
  177. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/compat.py +0 -0
  178. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/editor.py +0 -0
  179. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/exc.py +0 -0
  180. {alembic-1.13.1 → alembic-1.13.3}/alembic/util/pyfiles.py +0 -0
  181. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/dependency_links.txt +0 -0
  182. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/entry_points.txt +0 -0
  183. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/not-zip-safe +0 -0
  184. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/requires.txt +0 -0
  185. {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/top_level.txt +0 -0
  186. {alembic-1.13.1 → alembic-1.13.3}/docs/_images/api_overview.png +0 -0
  187. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/autogenerate.rst +0 -0
  188. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/commands.rst +0 -0
  189. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/config.rst +0 -0
  190. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/ddl.rst +0 -0
  191. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/index.rst +0 -0
  192. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/operations.rst +0 -0
  193. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/overview.rst +0 -0
  194. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/runtime.rst +0 -0
  195. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/script.rst +0 -0
  196. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/batch.rst +0 -0
  197. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/branches.rst +0 -0
  198. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/index.rst +0 -0
  199. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/naming.rst +0 -0
  200. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/offline.rst +0 -0
  201. {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/ops.rst +0 -0
  202. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/changelog.css +0 -0
  203. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/clipboard.min.js +0 -0
  204. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/copybutton.css +0 -0
  205. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/copybutton.js +0 -0
  206. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/copybutton_funcs.js +0 -0
  207. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/file.png +0 -0
  208. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/minus.png +0 -0
  209. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/nature_override.css +0 -0
  210. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/plus.png +0 -0
  211. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/site_custom_css.css +0 -0
  212. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/sphinx_highlight.js +0 -0
  213. {alembic-1.13.1 → alembic-1.13.3}/docs/_static/sphinx_paramlinks.css +0 -0
  214. {alembic-1.13.1 → alembic-1.13.3}/docs/build/_static/nature_override.css +0 -0
  215. {alembic-1.13.1 → alembic-1.13.3}/docs/build/_static/site_custom_css.css +0 -0
  216. {alembic-1.13.1 → alembic-1.13.3}/docs/build/_templates/site_custom_sidebars.html +0 -0
  217. {alembic-1.13.1 → alembic-1.13.3}/docs/build/api/api_overview.png +0 -0
  218. /alembic-1.13.1/docs/_sources/api/autogenerate.rst.txt → /alembic-1.13.3/docs/build/api/autogenerate.rst +0 -0
  219. /alembic-1.13.1/docs/_sources/api/commands.rst.txt → /alembic-1.13.3/docs/build/api/commands.rst +0 -0
  220. /alembic-1.13.1/docs/_sources/api/config.rst.txt → /alembic-1.13.3/docs/build/api/config.rst +0 -0
  221. /alembic-1.13.1/docs/_sources/api/ddl.rst.txt → /alembic-1.13.3/docs/build/api/ddl.rst +0 -0
  222. /alembic-1.13.1/docs/_sources/api/index.rst.txt → /alembic-1.13.3/docs/build/api/index.rst +0 -0
  223. /alembic-1.13.1/docs/_sources/api/operations.rst.txt → /alembic-1.13.3/docs/build/api/operations.rst +0 -0
  224. /alembic-1.13.1/docs/_sources/api/overview.rst.txt → /alembic-1.13.3/docs/build/api/overview.rst +0 -0
  225. /alembic-1.13.1/docs/_sources/api/runtime.rst.txt → /alembic-1.13.3/docs/build/api/runtime.rst +0 -0
  226. /alembic-1.13.1/docs/_sources/api/script.rst.txt → /alembic-1.13.3/docs/build/api/script.rst +0 -0
  227. /alembic-1.13.1/docs/_sources/batch.rst.txt → /alembic-1.13.3/docs/build/batch.rst +0 -0
  228. /alembic-1.13.1/docs/_sources/branches.rst.txt → /alembic-1.13.3/docs/build/branches.rst +0 -0
  229. /alembic-1.13.1/docs/_sources/index.rst.txt → /alembic-1.13.3/docs/build/index.rst +0 -0
  230. /alembic-1.13.1/docs/_sources/naming.rst.txt → /alembic-1.13.3/docs/build/naming.rst +0 -0
  231. /alembic-1.13.1/docs/_sources/offline.rst.txt → /alembic-1.13.3/docs/build/offline.rst +0 -0
  232. /alembic-1.13.1/docs/_sources/ops.rst.txt → /alembic-1.13.3/docs/build/ops.rst +0 -0
  233. {alembic-1.13.1 → alembic-1.13.3}/docs/build/unreleased/README.txt +0 -0
  234. {alembic-1.13.1 → alembic-1.13.3}/setup.py +0 -0
  235. {alembic-1.13.1 → alembic-1.13.3}/tests/__init__.py +0 -0
  236. {alembic-1.13.1 → alembic-1.13.3}/tests/_large_map.py +0 -0
  237. {alembic-1.13.1 → alembic-1.13.3}/tests/conftest.py +0 -0
  238. {alembic-1.13.1 → alembic-1.13.3}/tests/requirements.py +0 -0
  239. {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_composition.py +0 -0
  240. {alembic-1.13.1 → alembic-1.13.3}/tests/test_bulk_insert.py +0 -0
  241. {alembic-1.13.1 → alembic-1.13.3}/tests/test_editor.py +0 -0
  242. {alembic-1.13.1 → alembic-1.13.3}/tests/test_environment.py +0 -0
  243. {alembic-1.13.1 → alembic-1.13.3}/tests/test_external_dialect.py +0 -0
  244. {alembic-1.13.1 → alembic-1.13.3}/tests/test_mysql.py +0 -0
  245. {alembic-1.13.1 → alembic-1.13.3}/tests/test_offline_environment.py +0 -0
  246. {alembic-1.13.1 → alembic-1.13.3}/tests/test_op_naming_convention.py +0 -0
  247. {alembic-1.13.1 → alembic-1.13.3}/tests/test_oracle.py +0 -0
  248. {alembic-1.13.1 → alembic-1.13.3}/tests/test_post_write.py +0 -0
  249. {alembic-1.13.1 → alembic-1.13.3}/tests/test_revision.py +0 -0
  250. {alembic-1.13.1 → alembic-1.13.3}/tests/test_script_consumption.py +0 -0
  251. {alembic-1.13.1 → alembic-1.13.3}/tests/test_sqlite.py +0 -0
  252. {alembic-1.13.1 → alembic-1.13.3}/tests/test_stubs.py +0 -0
  253. {alembic-1.13.1 → alembic-1.13.3}/tests/test_suite.py +0 -0
  254. {alembic-1.13.1 → alembic-1.13.3}/tests/test_version_table.py +0 -0
  255. {alembic-1.13.1 → alembic-1.13.3}/tools/write_pyi.py +0 -0
@@ -1,4 +1,4 @@
1
- Copyright 2009-2023 Michael Bayer.
1
+ Copyright 2009-2024 Michael Bayer.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
16
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
17
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
19
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alembic
3
- Version: 1.13.1
3
+ Version: 1.13.3
4
4
  Summary: A database migration tool for SQLAlchemy.
5
5
  Home-page: https://alembic.sqlalchemy.org
6
6
  Author: Mike Bayer
@@ -1,4 +1,4 @@
1
1
  from . import context
2
2
  from . import op
3
3
 
4
- __version__ = "1.13.1"
4
+ __version__ = "1.13.3"
@@ -596,9 +596,9 @@ class RevisionContext:
596
596
  migration_script = self.generated_revisions[-1]
597
597
  if not getattr(migration_script, "_needs_render", False):
598
598
  migration_script.upgrade_ops_list[-1].upgrade_token = upgrade_token
599
- migration_script.downgrade_ops_list[
600
- -1
601
- ].downgrade_token = downgrade_token
599
+ migration_script.downgrade_ops_list[-1].downgrade_token = (
600
+ downgrade_token
601
+ )
602
602
  migration_script._needs_render = True
603
603
  else:
604
604
  migration_script._upgrade_ops.append(
@@ -983,7 +983,7 @@ def _normalize_computed_default(sqltext: str) -> str:
983
983
 
984
984
  """
985
985
 
986
- return re.sub(r"[ \(\)'\"`\[\]]", "", sqltext).lower()
986
+ return re.sub(r"[ \(\)'\"`\[\]\t\r\n]", "", sqltext).lower()
987
987
 
988
988
 
989
989
  def _compare_computed_default(
@@ -187,9 +187,11 @@ def _render_create_table_comment(
187
187
  prefix=_alembic_autogenerate_prefix(autogen_context),
188
188
  tname=op.table_name,
189
189
  comment="%r" % op.comment if op.comment is not None else None,
190
- existing="%r" % op.existing_comment
191
- if op.existing_comment is not None
192
- else None,
190
+ existing=(
191
+ "%r" % op.existing_comment
192
+ if op.existing_comment is not None
193
+ else None
194
+ ),
193
195
  schema="'%s'" % op.schema if op.schema is not None else None,
194
196
  indent=" ",
195
197
  )
@@ -216,9 +218,11 @@ def _render_drop_table_comment(
216
218
  return templ.format(
217
219
  prefix=_alembic_autogenerate_prefix(autogen_context),
218
220
  tname=op.table_name,
219
- existing="%r" % op.existing_comment
220
- if op.existing_comment is not None
221
- else None,
221
+ existing=(
222
+ "%r" % op.existing_comment
223
+ if op.existing_comment is not None
224
+ else None
225
+ ),
222
226
  schema="'%s'" % op.schema if op.schema is not None else None,
223
227
  indent=" ",
224
228
  )
@@ -275,6 +279,9 @@ def _add_table(autogen_context: AutogenContext, op: ops.CreateTableOp) -> str:
275
279
  prefixes = ", ".join("'%s'" % p for p in table._prefixes)
276
280
  text += ",\nprefixes=[%s]" % prefixes
277
281
 
282
+ if op.if_not_exists is not None:
283
+ text += ",\nif_not_exists=%r" % bool(op.if_not_exists)
284
+
278
285
  text += "\n)"
279
286
  return text
280
287
 
@@ -287,6 +294,10 @@ def _drop_table(autogen_context: AutogenContext, op: ops.DropTableOp) -> str:
287
294
  }
288
295
  if op.schema:
289
296
  text += ", schema=%r" % _ident(op.schema)
297
+
298
+ if op.if_exists is not None:
299
+ text += ", if_exists=%r" % bool(op.if_exists)
300
+
290
301
  text += ")"
291
302
  return text
292
303
 
@@ -320,6 +331,8 @@ def _add_index(autogen_context: AutogenContext, op: ops.CreateIndexOp) -> str:
320
331
  assert index.table is not None
321
332
 
322
333
  opts = _render_dialect_kwargs_items(autogen_context, index)
334
+ if op.if_not_exists is not None:
335
+ opts.append("if_not_exists=%r" % bool(op.if_not_exists))
323
336
  text = tmpl % {
324
337
  "prefix": _alembic_autogenerate_prefix(autogen_context),
325
338
  "name": _render_gen_name(autogen_context, index.name),
@@ -328,9 +341,11 @@ def _add_index(autogen_context: AutogenContext, op: ops.CreateIndexOp) -> str:
328
341
  _get_index_rendered_expressions(index, autogen_context)
329
342
  ),
330
343
  "unique": index.unique or False,
331
- "schema": (", schema=%r" % _ident(index.table.schema))
332
- if index.table.schema
333
- else "",
344
+ "schema": (
345
+ (", schema=%r" % _ident(index.table.schema))
346
+ if index.table.schema
347
+ else ""
348
+ ),
334
349
  "kwargs": ", " + ", ".join(opts) if opts else "",
335
350
  }
336
351
  return text
@@ -350,6 +365,8 @@ def _drop_index(autogen_context: AutogenContext, op: ops.DropIndexOp) -> str:
350
365
  "table_name=%(table_name)r%(schema)s%(kwargs)s)"
351
366
  )
352
367
  opts = _render_dialect_kwargs_items(autogen_context, index)
368
+ if op.if_exists is not None:
369
+ opts.append("if_exists=%r" % bool(op.if_exists))
353
370
  text = tmpl % {
354
371
  "prefix": _alembic_autogenerate_prefix(autogen_context),
355
372
  "name": _render_gen_name(autogen_context, op.index_name),
@@ -592,9 +609,11 @@ def _get_index_rendered_expressions(
592
609
  idx: Index, autogen_context: AutogenContext
593
610
  ) -> List[str]:
594
611
  return [
595
- repr(_ident(getattr(exp, "name", None)))
596
- if isinstance(exp, sa_schema.Column)
597
- else _render_potential_expr(exp, autogen_context, is_index=True)
612
+ (
613
+ repr(_ident(getattr(exp, "name", None)))
614
+ if isinstance(exp, sa_schema.Column)
615
+ else _render_potential_expr(exp, autogen_context, is_index=True)
616
+ )
598
617
  for exp in idx.expressions
599
618
  ]
600
619
 
@@ -1075,9 +1094,11 @@ def _render_check_constraint(
1075
1094
  )
1076
1095
  return "%(prefix)sCheckConstraint(%(sqltext)s%(opts)s)" % {
1077
1096
  "prefix": _sqlalchemy_autogenerate_prefix(autogen_context),
1078
- "opts": ", " + (", ".join("%s=%s" % (k, v) for k, v in opts))
1079
- if opts
1080
- else "",
1097
+ "opts": (
1098
+ ", " + (", ".join("%s=%s" % (k, v) for k, v in opts))
1099
+ if opts
1100
+ else ""
1101
+ ),
1081
1102
  "sqltext": _render_potential_expr(
1082
1103
  constraint.sqltext, autogen_context, wrap_in_text=False
1083
1104
  ),
@@ -49,7 +49,7 @@ def init(
49
49
 
50
50
  :param config: a :class:`.Config` object.
51
51
 
52
- :param directory: string path of the target directory
52
+ :param directory: string path of the target directory.
53
53
 
54
54
  :param template: string name of the migration environment template to
55
55
  use.
@@ -174,7 +174,7 @@ def revision(
174
174
  will be applied to the structure generated by the revision process
175
175
  where it can be altered programmatically. Note that unlike all
176
176
  the other parameters, this option is only available via programmatic
177
- use of :func:`.command.revision`
177
+ use of :func:`.command.revision`.
178
178
 
179
179
  """
180
180
 
@@ -315,9 +315,11 @@ def merge(
315
315
 
316
316
  :param config: a :class:`.Config` instance
317
317
 
318
- :param message: string message to apply to the revision
318
+ :param revisions: The revisions to merge.
319
319
 
320
- :param branch_label: string label name to apply to the new revision
320
+ :param message: string message to apply to the revision.
321
+
322
+ :param branch_label: string label name to apply to the new revision.
321
323
 
322
324
  :param rev_id: hardcoded revision identifier instead of generating a new
323
325
  one.
@@ -370,9 +372,10 @@ def upgrade(
370
372
 
371
373
  :param config: a :class:`.Config` instance.
372
374
 
373
- :param revision: string revision target or range for --sql mode
375
+ :param revision: string revision target or range for --sql mode. May be
376
+ ``"heads"`` to target the most recent revision(s).
374
377
 
375
- :param sql: if True, use ``--sql`` mode
378
+ :param sql: if True, use ``--sql`` mode.
376
379
 
377
380
  :param tag: an arbitrary "tag" that can be intercepted by custom
378
381
  ``env.py`` scripts via the :meth:`.EnvironmentContext.get_tag_argument`
@@ -413,9 +416,10 @@ def downgrade(
413
416
 
414
417
  :param config: a :class:`.Config` instance.
415
418
 
416
- :param revision: string revision target or range for --sql mode
419
+ :param revision: string revision target or range for --sql mode. May
420
+ be ``"base"`` to target the first revision.
417
421
 
418
- :param sql: if True, use ``--sql`` mode
422
+ :param sql: if True, use ``--sql`` mode.
419
423
 
420
424
  :param tag: an arbitrary "tag" that can be intercepted by custom
421
425
  ``env.py`` scripts via the :meth:`.EnvironmentContext.get_tag_argument`
@@ -449,12 +453,13 @@ def downgrade(
449
453
  script.run_env()
450
454
 
451
455
 
452
- def show(config, rev):
456
+ def show(config: Config, rev: str) -> None:
453
457
  """Show the revision(s) denoted by the given symbol.
454
458
 
455
459
  :param config: a :class:`.Config` instance.
456
460
 
457
- :param revision: string revision target
461
+ :param rev: string revision target. May be ``"current"`` to show the
462
+ revision(s) currently applied in the database.
458
463
 
459
464
  """
460
465
 
@@ -484,7 +489,7 @@ def history(
484
489
 
485
490
  :param config: a :class:`.Config` instance.
486
491
 
487
- :param rev_range: string revision range
492
+ :param rev_range: string revision range.
488
493
 
489
494
  :param verbose: output in verbose mode.
490
495
 
@@ -543,7 +548,9 @@ def history(
543
548
  _display_history(config, script, base, head)
544
549
 
545
550
 
546
- def heads(config, verbose=False, resolve_dependencies=False):
551
+ def heads(
552
+ config: Config, verbose: bool = False, resolve_dependencies: bool = False
553
+ ) -> None:
547
554
  """Show current available heads in the script directory.
548
555
 
549
556
  :param config: a :class:`.Config` instance.
@@ -568,7 +575,7 @@ def heads(config, verbose=False, resolve_dependencies=False):
568
575
  )
569
576
 
570
577
 
571
- def branches(config, verbose=False):
578
+ def branches(config: Config, verbose: bool = False) -> None:
572
579
  """Show current branch points.
573
580
 
574
581
  :param config: a :class:`.Config` instance.
@@ -638,7 +645,9 @@ def stamp(
638
645
  :param config: a :class:`.Config` instance.
639
646
 
640
647
  :param revision: target revision or list of revisions. May be a list
641
- to indicate stamping of multiple branch heads.
648
+ to indicate stamping of multiple branch heads; may be ``"base"``
649
+ to remove all revisions from the table or ``"heads"`` to stamp the
650
+ most recent revision(s).
642
651
 
643
652
  .. note:: this parameter is called "revisions" in the command line
644
653
  interface.
@@ -728,7 +737,7 @@ def ensure_version(config: Config, sql: bool = False) -> None:
728
737
 
729
738
  :param config: a :class:`.Config` instance.
730
739
 
731
- :param sql: use ``--sql`` mode
740
+ :param sql: use ``--sql`` mode.
732
741
 
733
742
  .. versionadded:: 1.7.6
734
743
 
@@ -221,8 +221,7 @@ class Config:
221
221
  @overload
222
222
  def get_section(
223
223
  self, name: str, default: None = ...
224
- ) -> Optional[Dict[str, str]]:
225
- ...
224
+ ) -> Optional[Dict[str, str]]: ...
226
225
 
227
226
  # "default" here could also be a TypeVar
228
227
  # _MT = TypeVar("_MT", bound=Mapping[str, str]),
@@ -230,14 +229,12 @@ class Config:
230
229
  @overload
231
230
  def get_section(
232
231
  self, name: str, default: Dict[str, str]
233
- ) -> Dict[str, str]:
234
- ...
232
+ ) -> Dict[str, str]: ...
235
233
 
236
234
  @overload
237
235
  def get_section(
238
236
  self, name: str, default: Mapping[str, str]
239
- ) -> Union[Dict[str, str], Mapping[str, str]]:
240
- ...
237
+ ) -> Union[Dict[str, str], Mapping[str, str]]: ...
241
238
 
242
239
  def get_section(
243
240
  self, name: str, default: Optional[Mapping[str, str]] = None
@@ -313,14 +310,12 @@ class Config:
313
310
  return default
314
311
 
315
312
  @overload
316
- def get_main_option(self, name: str, default: str) -> str:
317
- ...
313
+ def get_main_option(self, name: str, default: str) -> str: ...
318
314
 
319
315
  @overload
320
316
  def get_main_option(
321
317
  self, name: str, default: Optional[str] = None
322
- ) -> Optional[str]:
323
- ...
318
+ ) -> Optional[str]: ...
324
319
 
325
320
  def get_main_option(
326
321
  self, name: str, default: Optional[str] = None
@@ -287,18 +287,22 @@ class _fk_constraint_sig(_constraint_sig[ForeignKeyConstraint]):
287
287
  self.target_table,
288
288
  tuple(self.target_columns),
289
289
  ) + (
290
- (None if onupdate.lower() == "no action" else onupdate.lower())
291
- if onupdate
292
- else None,
293
- (None if ondelete.lower() == "no action" else ondelete.lower())
294
- if ondelete
295
- else None,
290
+ (
291
+ (None if onupdate.lower() == "no action" else onupdate.lower())
292
+ if onupdate
293
+ else None
294
+ ),
295
+ (
296
+ (None if ondelete.lower() == "no action" else ondelete.lower())
297
+ if ondelete
298
+ else None
299
+ ),
296
300
  # convert initially + deferrable into one three-state value
297
- "initially_deferrable"
298
- if initially and initially.lower() == "deferred"
299
- else "deferrable"
300
- if deferrable
301
- else "not deferrable",
301
+ (
302
+ "initially_deferrable"
303
+ if initially and initially.lower() == "deferred"
304
+ else "deferrable" if deferrable else "not deferrable"
305
+ ),
302
306
  )
303
307
 
304
308
  @util.memoized_property
@@ -40,7 +40,6 @@ _ServerDefault = Union["TextClause", "FetchedValue", "Function[Any]", str]
40
40
 
41
41
 
42
42
  class AlterTable(DDLElement):
43
-
44
43
  """Represent an ALTER TABLE statement.
45
44
 
46
45
  Only the string name and optional schema name of the table
@@ -238,9 +237,11 @@ def visit_column_default(
238
237
  return "%s %s %s" % (
239
238
  alter_table(compiler, element.table_name, element.schema),
240
239
  alter_column(compiler, element.column_name),
241
- "SET DEFAULT %s" % format_server_default(compiler, element.default)
242
- if element.default is not None
243
- else "DROP DEFAULT",
240
+ (
241
+ "SET DEFAULT %s" % format_server_default(compiler, element.default)
242
+ if element.default is not None
243
+ else "DROP DEFAULT"
244
+ ),
244
245
  )
245
246
 
246
247
 
@@ -77,7 +77,6 @@ _impls: Dict[str, Type[DefaultImpl]] = {}
77
77
 
78
78
 
79
79
  class DefaultImpl(metaclass=ImplMeta):
80
-
81
80
  """Provide the entrypoint for major migration operations,
82
81
  including database-specific behavioral variances.
83
82
 
@@ -168,16 +167,15 @@ class DefaultImpl(metaclass=ImplMeta):
168
167
  def _exec(
169
168
  self,
170
169
  construct: Union[Executable, str],
171
- execution_options: Optional[dict[str, Any]] = None,
172
- multiparams: Sequence[dict] = (),
173
- params: Dict[str, Any] = util.immutabledict(),
170
+ execution_options: Optional[Mapping[str, Any]] = None,
171
+ multiparams: Optional[Sequence[Mapping[str, Any]]] = None,
172
+ params: Mapping[str, Any] = util.immutabledict(),
174
173
  ) -> Optional[CursorResult]:
175
174
  if isinstance(construct, str):
176
175
  construct = text(construct)
177
176
  if self.as_sql:
178
- if multiparams or params:
179
- # TODO: coverage
180
- raise Exception("Execution arguments not allowed with as_sql")
177
+ if multiparams is not None or params:
178
+ raise TypeError("SQL parameters not allowed with as_sql")
181
179
 
182
180
  compile_kw: dict[str, Any]
183
181
  if self.literal_binds and not isinstance(
@@ -200,11 +198,16 @@ class DefaultImpl(metaclass=ImplMeta):
200
198
  assert conn is not None
201
199
  if execution_options:
202
200
  conn = conn.execution_options(**execution_options)
203
- if params:
204
- assert isinstance(multiparams, tuple)
205
- multiparams += (params,)
206
201
 
207
- return conn.execute(construct, multiparams)
202
+ if params and multiparams is not None:
203
+ raise TypeError(
204
+ "Can't send params and multiparams at the same time"
205
+ )
206
+
207
+ if multiparams:
208
+ return conn.execute(construct, multiparams)
209
+ else:
210
+ return conn.execute(construct, params)
208
211
 
209
212
  def execute(
210
213
  self,
@@ -359,11 +362,11 @@ class DefaultImpl(metaclass=ImplMeta):
359
362
  base.RenameTable(old_table_name, new_table_name, schema=schema)
360
363
  )
361
364
 
362
- def create_table(self, table: Table) -> None:
365
+ def create_table(self, table: Table, **kw: Any) -> None:
363
366
  table.dispatch.before_create(
364
367
  table, self.connection, checkfirst=False, _ddl_runner=self
365
368
  )
366
- self._exec(schema.CreateTable(table))
369
+ self._exec(schema.CreateTable(table, **kw))
367
370
  table.dispatch.after_create(
368
371
  table, self.connection, checkfirst=False, _ddl_runner=self
369
372
  )
@@ -382,11 +385,11 @@ class DefaultImpl(metaclass=ImplMeta):
382
385
  if comment and with_comment:
383
386
  self.create_column_comment(column)
384
387
 
385
- def drop_table(self, table: Table) -> None:
388
+ def drop_table(self, table: Table, **kw: Any) -> None:
386
389
  table.dispatch.before_drop(
387
390
  table, self.connection, checkfirst=False, _ddl_runner=self
388
391
  )
389
- self._exec(schema.DropTable(table))
392
+ self._exec(schema.DropTable(table, **kw))
390
393
  table.dispatch.after_drop(
391
394
  table, self.connection, checkfirst=False, _ddl_runner=self
392
395
  )
@@ -421,13 +424,15 @@ class DefaultImpl(metaclass=ImplMeta):
421
424
  self._exec(
422
425
  sqla_compat._insert_inline(table).values(
423
426
  **{
424
- k: sqla_compat._literal_bindparam(
425
- k, v, type_=table.c[k].type
426
- )
427
- if not isinstance(
428
- v, sqla_compat._literal_bindparam
427
+ k: (
428
+ sqla_compat._literal_bindparam(
429
+ k, v, type_=table.c[k].type
430
+ )
431
+ if not isinstance(
432
+ v, sqla_compat._literal_bindparam
433
+ )
434
+ else v
429
435
  )
430
- else v
431
436
  for k, v in row.items()
432
437
  }
433
438
  )
@@ -94,21 +94,29 @@ class MySQLImpl(DefaultImpl):
94
94
  column_name,
95
95
  schema=schema,
96
96
  newname=name if name is not None else column_name,
97
- nullable=nullable
98
- if nullable is not None
99
- else existing_nullable
100
- if existing_nullable is not None
101
- else True,
97
+ nullable=(
98
+ nullable
99
+ if nullable is not None
100
+ else (
101
+ existing_nullable
102
+ if existing_nullable is not None
103
+ else True
104
+ )
105
+ ),
102
106
  type_=type_ if type_ is not None else existing_type,
103
- default=server_default
104
- if server_default is not False
105
- else existing_server_default,
106
- autoincrement=autoincrement
107
- if autoincrement is not None
108
- else existing_autoincrement,
109
- comment=comment
110
- if comment is not False
111
- else existing_comment,
107
+ default=(
108
+ server_default
109
+ if server_default is not False
110
+ else existing_server_default
111
+ ),
112
+ autoincrement=(
113
+ autoincrement
114
+ if autoincrement is not None
115
+ else existing_autoincrement
116
+ ),
117
+ comment=(
118
+ comment if comment is not False else existing_comment
119
+ ),
112
120
  )
113
121
  )
114
122
  elif (
@@ -123,21 +131,29 @@ class MySQLImpl(DefaultImpl):
123
131
  column_name,
124
132
  schema=schema,
125
133
  newname=name if name is not None else column_name,
126
- nullable=nullable
127
- if nullable is not None
128
- else existing_nullable
129
- if existing_nullable is not None
130
- else True,
134
+ nullable=(
135
+ nullable
136
+ if nullable is not None
137
+ else (
138
+ existing_nullable
139
+ if existing_nullable is not None
140
+ else True
141
+ )
142
+ ),
131
143
  type_=type_ if type_ is not None else existing_type,
132
- default=server_default
133
- if server_default is not False
134
- else existing_server_default,
135
- autoincrement=autoincrement
136
- if autoincrement is not None
137
- else existing_autoincrement,
138
- comment=comment
139
- if comment is not False
140
- else existing_comment,
144
+ default=(
145
+ server_default
146
+ if server_default is not False
147
+ else existing_server_default
148
+ ),
149
+ autoincrement=(
150
+ autoincrement
151
+ if autoincrement is not None
152
+ else existing_autoincrement
153
+ ),
154
+ comment=(
155
+ comment if comment is not False else existing_comment
156
+ ),
141
157
  )
142
158
  )
143
159
  elif server_default is not False:
@@ -368,9 +384,11 @@ def _mysql_alter_default(
368
384
  return "%s ALTER COLUMN %s %s" % (
369
385
  alter_table(compiler, element.table_name, element.schema),
370
386
  format_column_name(compiler, element.column_name),
371
- "SET DEFAULT %s" % format_server_default(compiler, element.default)
372
- if element.default is not None
373
- else "DROP DEFAULT",
387
+ (
388
+ "SET DEFAULT %s" % format_server_default(compiler, element.default)
389
+ if element.default is not None
390
+ else "DROP DEFAULT"
391
+ ),
374
392
  )
375
393
 
376
394
 
@@ -141,9 +141,11 @@ def visit_column_default(
141
141
  return "%s %s %s" % (
142
142
  alter_table(compiler, element.table_name, element.schema),
143
143
  alter_column(compiler, element.column_name),
144
- "DEFAULT %s" % format_server_default(compiler, element.default)
145
- if element.default is not None
146
- else "DEFAULT NULL",
144
+ (
145
+ "DEFAULT %s" % format_server_default(compiler, element.default)
146
+ if element.default is not None
147
+ else "DEFAULT NULL"
148
+ ),
147
149
  )
148
150
 
149
151
 
@@ -218,7 +218,8 @@ class PostgresqlImpl(DefaultImpl):
218
218
  "join pg_class t on t.oid=d.refobjid "
219
219
  "join pg_attribute a on a.attrelid=t.oid and "
220
220
  "a.attnum=d.refobjsubid "
221
- "where c.relkind='S' and c.relname=:seqname"
221
+ "where c.relkind='S' and "
222
+ "c.oid=cast(:seqname as regclass)"
222
223
  ),
223
224
  seqname=seq_match.group(1),
224
225
  ).first()
@@ -747,7 +747,12 @@ def create_primary_key(
747
747
 
748
748
  """
749
749
 
750
- def create_table(table_name: str, *columns: SchemaItem, **kw: Any) -> Table:
750
+ def create_table(
751
+ table_name: str,
752
+ *columns: SchemaItem,
753
+ if_not_exists: Optional[bool] = None,
754
+ **kw: Any,
755
+ ) -> Table:
751
756
  r"""Issue a "create table" instruction using the current migration
752
757
  context.
753
758
 
@@ -818,6 +823,10 @@ def create_table(table_name: str, *columns: SchemaItem, **kw: Any) -> Table:
818
823
  quoting of the schema outside of the default behavior, use
819
824
  the SQLAlchemy construct
820
825
  :class:`~sqlalchemy.sql.elements.quoted_name`.
826
+ :param if_not_exists: If True, adds IF NOT EXISTS operator when
827
+ creating the new table.
828
+
829
+ .. versionadded:: 1.13.3
821
830
  :param \**kw: Other keyword arguments are passed to the underlying
822
831
  :class:`sqlalchemy.schema.Table` object created for the command.
823
832
 
@@ -998,7 +1007,11 @@ def drop_index(
998
1007
  """
999
1008
 
1000
1009
  def drop_table(
1001
- table_name: str, *, schema: Optional[str] = None, **kw: Any
1010
+ table_name: str,
1011
+ *,
1012
+ schema: Optional[str] = None,
1013
+ if_exists: Optional[bool] = None,
1014
+ **kw: Any,
1002
1015
  ) -> None:
1003
1016
  r"""Issue a "drop table" instruction using the current
1004
1017
  migration context.
@@ -1013,6 +1026,10 @@ def drop_table(
1013
1026
  quoting of the schema outside of the default behavior, use
1014
1027
  the SQLAlchemy construct
1015
1028
  :class:`~sqlalchemy.sql.elements.quoted_name`.
1029
+ :param if_exists: If True, adds IF EXISTS operator when
1030
+ dropping the table.
1031
+
1032
+ .. versionadded:: 1.13.3
1016
1033
  :param \**kw: Other keyword arguments are passed to the underlying
1017
1034
  :class:`sqlalchemy.schema.Table` object created for the command.
1018
1035