alembic 1.13.2__tar.gz → 1.14.0__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.
- {alembic-1.13.2/alembic.egg-info → alembic-1.14.0}/PKG-INFO +1 -1
- {alembic-1.13.2 → alembic-1.14.0}/alembic/__init__.py +1 -1
- {alembic-1.13.2 → alembic-1.14.0}/alembic/autogenerate/render.py +11 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/base.py +9 -9
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/impl.py +43 -6
- {alembic-1.13.2 → alembic-1.14.0}/alembic/op.pyi +19 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/operations/base.py +19 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/operations/ops.py +16 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/operations/toimpl.py +14 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/runtime/migration.py +12 -17
- {alembic-1.13.2 → alembic-1.14.0}/alembic/script/base.py +6 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/async/alembic.ini.mako +3 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/generic/alembic.ini.mako +3 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/multidb/alembic.ini.mako +3 -2
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/assertions.py +13 -4
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/env.py +4 -4
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/sqla_compat.py +1 -1
- {alembic-1.13.2 → alembic-1.14.0/alembic.egg-info}/PKG-INFO +1 -1
- {alembic-1.13.2 → alembic-1.14.0}/alembic.egg-info/SOURCES.txt +32 -21
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/changelog.rst +64 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/cookbook.rst +36 -17
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/tutorial.rst +3 -2
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/basic.css +3 -14
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/doctools.js +0 -7
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/documentation_options.js +2 -2
- alembic-1.14.0/docs/_static/images/logo_colab.png +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/language_data.js +0 -7
- alembic-1.14.0/docs/_static/pygments.css +152 -0
- alembic-1.14.0/docs/_static/sbt-webpack-macros.html +11 -0
- alembic-1.14.0/docs/_static/scripts/bootstrap.js +3 -0
- alembic-1.14.0/docs/_static/scripts/bootstrap.js.LICENSE.txt +5 -0
- alembic-1.14.0/docs/_static/scripts/fontawesome.js +3 -0
- alembic-1.14.0/docs/_static/scripts/fontawesome.js.LICENSE.txt +5 -0
- alembic-1.14.0/docs/_static/scripts/pydata-sphinx-theme.js +2 -0
- alembic-1.14.0/docs/_static/scripts/sphinx-book-theme.js +2 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/searchtools.js +29 -16
- alembic-1.14.0/docs/_static/styles/pydata-sphinx-theme.css +32 -0
- alembic-1.14.0/docs/_static/styles/sphinx-book-theme.css +9 -0
- alembic-1.14.0/docs/_static/styles/theme.css +2 -0
- alembic-1.14.0/docs/_static/webpack-macros.html +24 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/autogenerate.html +511 -141
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/commands.html +464 -119
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/config.html +472 -124
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/ddl.html +921 -397
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/index.html +398 -81
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/operations.html +651 -217
- alembic-1.14.0/docs/api/overview.html +478 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/runtime.html +522 -153
- {alembic-1.13.2 → alembic-1.14.0}/docs/api/script.html +572 -183
- {alembic-1.13.2 → alembic-1.14.0}/docs/autogenerate.html +472 -117
- {alembic-1.13.2 → alembic-1.14.0}/docs/batch.html +448 -105
- {alembic-1.13.2 → alembic-1.14.0}/docs/branches.html +456 -109
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/Makefile +1 -1
- alembic-1.13.2/docs/_sources/changelog.rst.txt → alembic-1.14.0/docs/build/changelog.rst +64 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/conf.py +30 -9
- alembic-1.13.2/docs/_sources/cookbook.rst.txt → alembic-1.14.0/docs/build/cookbook.rst +36 -17
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/requirements.txt +3 -0
- alembic-1.13.2/docs/_sources/tutorial.rst.txt → alembic-1.14.0/docs/build/tutorial.rst +3 -2
- {alembic-1.13.2 → alembic-1.14.0}/docs/changelog.html +1697 -721
- {alembic-1.13.2 → alembic-1.14.0}/docs/cookbook.html +531 -152
- alembic-1.14.0/docs/front.html +565 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/genindex.html +351 -64
- {alembic-1.13.2 → alembic-1.14.0}/docs/index.html +426 -80
- {alembic-1.13.2 → alembic-1.14.0}/docs/naming.html +425 -91
- {alembic-1.13.2 → alembic-1.14.0}/docs/offline.html +428 -93
- {alembic-1.13.2 → alembic-1.14.0}/docs/ops.html +571 -177
- alembic-1.14.0/docs/py-modindex.html +456 -0
- alembic-1.14.0/docs/search.html +372 -0
- alembic-1.14.0/docs/searchindex.js +1 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/tutorial.html +460 -113
- {alembic-1.13.2 → alembic-1.14.0}/pyproject.toml +11 -3
- {alembic-1.13.2 → alembic-1.14.0}/setup.cfg +0 -8
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_autogen_render.py +62 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_config.py +9 -2
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_op.py +20 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_version_table.py +46 -0
- {alembic-1.13.2 → alembic-1.14.0}/tox.ini +0 -1
- alembic-1.13.2/docs/_static/nature.css +0 -252
- alembic-1.13.2/docs/_static/pygments.css +0 -75
- alembic-1.13.2/docs/api/overview.html +0 -163
- alembic-1.13.2/docs/front.html +0 -225
- alembic-1.13.2/docs/py-modindex.html +0 -181
- alembic-1.13.2/docs/search.html +0 -103
- alembic-1.13.2/docs/searchindex.js +0 -1
- {alembic-1.13.2 → alembic-1.14.0}/CHANGES +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/LICENSE +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/MANIFEST.in +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/README.rst +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/README.unittests.rst +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/__main__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/autogenerate/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/autogenerate/api.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/autogenerate/compare.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/autogenerate/rewriter.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/command.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/config.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/context.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/context.pyi +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/_autogen.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/mssql.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/mysql.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/oracle.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/postgresql.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/ddl/sqlite.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/environment.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/migration.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/op.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/operations/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/operations/batch.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/operations/schemaobj.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/py.typed +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/runtime/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/runtime/environment.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/script/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/script/revision.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/script/write_hooks.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/async/README +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/async/env.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/async/script.py.mako +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/generic/README +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/generic/env.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/generic/script.py.mako +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/multidb/README +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/multidb/env.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/templates/multidb/script.py.mako +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/fixtures.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/plugin/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/plugin/bootstrap.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/requirements.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/schemacompare.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/_autogen_fixtures.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_autogen_comments.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_autogen_computed.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_autogen_diffs.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_autogen_fks.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_autogen_identity.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_environment.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/suite/test_op.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/util.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/testing/warnings.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/compat.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/editor.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/exc.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/langhelpers.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/messaging.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic/util/pyfiles.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic.egg-info/dependency_links.txt +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic.egg-info/entry_points.txt +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic.egg-info/not-zip-safe +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic.egg-info/requires.txt +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/alembic.egg-info/top_level.txt +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_images/api_overview.png +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/autogenerate.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/commands.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/config.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/ddl.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/index.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/operations.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/overview.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/runtime.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/api/script.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/autogenerate.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/batch.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/branches.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/front.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/index.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/naming.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/offline.rst +0 -0
- {alembic-1.13.2/docs/build → alembic-1.14.0/docs/_sources}/ops.rst +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/changelog.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/clipboard.min.js +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/copybutton.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/copybutton.js +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/copybutton_funcs.js +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/file.png +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/minus.png +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/nature_override.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/plus.png +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/site_custom_css.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/sphinx_highlight.js +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/_static/sphinx_paramlinks.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/_static/nature_override.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/_static/site_custom_css.css +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/_templates/site_custom_sidebars.html +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/api/api_overview.png +0 -0
- /alembic-1.13.2/docs/_sources/api/autogenerate.rst.txt → /alembic-1.14.0/docs/build/api/autogenerate.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/commands.rst.txt → /alembic-1.14.0/docs/build/api/commands.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/config.rst.txt → /alembic-1.14.0/docs/build/api/config.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/ddl.rst.txt → /alembic-1.14.0/docs/build/api/ddl.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/index.rst.txt → /alembic-1.14.0/docs/build/api/index.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/operations.rst.txt → /alembic-1.14.0/docs/build/api/operations.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/overview.rst.txt → /alembic-1.14.0/docs/build/api/overview.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/runtime.rst.txt → /alembic-1.14.0/docs/build/api/runtime.rst +0 -0
- /alembic-1.13.2/docs/_sources/api/script.rst.txt → /alembic-1.14.0/docs/build/api/script.rst +0 -0
- /alembic-1.13.2/docs/_sources/autogenerate.rst.txt → /alembic-1.14.0/docs/build/autogenerate.rst +0 -0
- /alembic-1.13.2/docs/_sources/batch.rst.txt → /alembic-1.14.0/docs/build/batch.rst +0 -0
- /alembic-1.13.2/docs/_sources/branches.rst.txt → /alembic-1.14.0/docs/build/branches.rst +0 -0
- /alembic-1.13.2/docs/_sources/front.rst.txt → /alembic-1.14.0/docs/build/front.rst +0 -0
- /alembic-1.13.2/docs/_sources/index.rst.txt → /alembic-1.14.0/docs/build/index.rst +0 -0
- /alembic-1.13.2/docs/_sources/naming.rst.txt → /alembic-1.14.0/docs/build/naming.rst +0 -0
- /alembic-1.13.2/docs/_sources/offline.rst.txt → /alembic-1.14.0/docs/build/offline.rst +0 -0
- /alembic-1.13.2/docs/_sources/ops.rst.txt → /alembic-1.14.0/docs/build/ops.rst +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/docs/build/unreleased/README.txt +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/setup.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/__init__.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/_large_map.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/conftest.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/requirements.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_autogen_composition.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_autogen_diffs.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_autogen_indexes.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_batch.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_bulk_insert.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_command.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_editor.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_environment.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_external_dialect.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_impl.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_messaging.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_mssql.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_mysql.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_offline_environment.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_op_naming_convention.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_oracle.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_post_write.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_postgresql.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_revision.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_script_consumption.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_script_production.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_sqlite.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_stubs.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_suite.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tests/test_version_traversal.py +0 -0
- {alembic-1.13.2 → alembic-1.14.0}/tools/write_pyi.py +0 -0
@@ -279,6 +279,9 @@ def _add_table(autogen_context: AutogenContext, op: ops.CreateTableOp) -> str:
|
|
279
279
|
prefixes = ", ".join("'%s'" % p for p in table._prefixes)
|
280
280
|
text += ",\nprefixes=[%s]" % prefixes
|
281
281
|
|
282
|
+
if op.if_not_exists is not None:
|
283
|
+
text += ",\nif_not_exists=%r" % bool(op.if_not_exists)
|
284
|
+
|
282
285
|
text += "\n)"
|
283
286
|
return text
|
284
287
|
|
@@ -291,6 +294,10 @@ def _drop_table(autogen_context: AutogenContext, op: ops.DropTableOp) -> str:
|
|
291
294
|
}
|
292
295
|
if op.schema:
|
293
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
|
+
|
294
301
|
text += ")"
|
295
302
|
return text
|
296
303
|
|
@@ -324,6 +331,8 @@ def _add_index(autogen_context: AutogenContext, op: ops.CreateIndexOp) -> str:
|
|
324
331
|
assert index.table is not None
|
325
332
|
|
326
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))
|
327
336
|
text = tmpl % {
|
328
337
|
"prefix": _alembic_autogenerate_prefix(autogen_context),
|
329
338
|
"name": _render_gen_name(autogen_context, index.name),
|
@@ -356,6 +365,8 @@ def _drop_index(autogen_context: AutogenContext, op: ops.DropIndexOp) -> str:
|
|
356
365
|
"table_name=%(table_name)r%(schema)s%(kwargs)s)"
|
357
366
|
)
|
358
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))
|
359
370
|
text = tmpl % {
|
360
371
|
"prefix": _alembic_autogenerate_prefix(autogen_context),
|
361
372
|
"name": _render_gen_name(autogen_context, op.index_name),
|
@@ -175,7 +175,7 @@ class ColumnComment(AlterColumn):
|
|
175
175
|
self.comment = comment
|
176
176
|
|
177
177
|
|
178
|
-
@compiles(RenameTable)
|
178
|
+
@compiles(RenameTable)
|
179
179
|
def visit_rename_table(
|
180
180
|
element: RenameTable, compiler: DDLCompiler, **kw
|
181
181
|
) -> str:
|
@@ -185,7 +185,7 @@ def visit_rename_table(
|
|
185
185
|
)
|
186
186
|
|
187
187
|
|
188
|
-
@compiles(AddColumn)
|
188
|
+
@compiles(AddColumn)
|
189
189
|
def visit_add_column(element: AddColumn, compiler: DDLCompiler, **kw) -> str:
|
190
190
|
return "%s %s" % (
|
191
191
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -193,7 +193,7 @@ def visit_add_column(element: AddColumn, compiler: DDLCompiler, **kw) -> str:
|
|
193
193
|
)
|
194
194
|
|
195
195
|
|
196
|
-
@compiles(DropColumn)
|
196
|
+
@compiles(DropColumn)
|
197
197
|
def visit_drop_column(element: DropColumn, compiler: DDLCompiler, **kw) -> str:
|
198
198
|
return "%s %s" % (
|
199
199
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -201,7 +201,7 @@ def visit_drop_column(element: DropColumn, compiler: DDLCompiler, **kw) -> str:
|
|
201
201
|
)
|
202
202
|
|
203
203
|
|
204
|
-
@compiles(ColumnNullable)
|
204
|
+
@compiles(ColumnNullable)
|
205
205
|
def visit_column_nullable(
|
206
206
|
element: ColumnNullable, compiler: DDLCompiler, **kw
|
207
207
|
) -> str:
|
@@ -212,7 +212,7 @@ def visit_column_nullable(
|
|
212
212
|
)
|
213
213
|
|
214
214
|
|
215
|
-
@compiles(ColumnType)
|
215
|
+
@compiles(ColumnType)
|
216
216
|
def visit_column_type(element: ColumnType, compiler: DDLCompiler, **kw) -> str:
|
217
217
|
return "%s %s %s" % (
|
218
218
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -221,7 +221,7 @@ def visit_column_type(element: ColumnType, compiler: DDLCompiler, **kw) -> str:
|
|
221
221
|
)
|
222
222
|
|
223
223
|
|
224
|
-
@compiles(ColumnName)
|
224
|
+
@compiles(ColumnName)
|
225
225
|
def visit_column_name(element: ColumnName, compiler: DDLCompiler, **kw) -> str:
|
226
226
|
return "%s RENAME %s TO %s" % (
|
227
227
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -230,7 +230,7 @@ def visit_column_name(element: ColumnName, compiler: DDLCompiler, **kw) -> str:
|
|
230
230
|
)
|
231
231
|
|
232
232
|
|
233
|
-
@compiles(ColumnDefault)
|
233
|
+
@compiles(ColumnDefault)
|
234
234
|
def visit_column_default(
|
235
235
|
element: ColumnDefault, compiler: DDLCompiler, **kw
|
236
236
|
) -> str:
|
@@ -245,7 +245,7 @@ def visit_column_default(
|
|
245
245
|
)
|
246
246
|
|
247
247
|
|
248
|
-
@compiles(ComputedColumnDefault)
|
248
|
+
@compiles(ComputedColumnDefault)
|
249
249
|
def visit_computed_column(
|
250
250
|
element: ComputedColumnDefault, compiler: DDLCompiler, **kw
|
251
251
|
):
|
@@ -255,7 +255,7 @@ def visit_computed_column(
|
|
255
255
|
)
|
256
256
|
|
257
257
|
|
258
|
-
@compiles(IdentityColumnDefault)
|
258
|
+
@compiles(IdentityColumnDefault)
|
259
259
|
def visit_identity_column(
|
260
260
|
element: IdentityColumnDefault, compiler: DDLCompiler, **kw
|
261
261
|
):
|
@@ -21,7 +21,12 @@ from typing import TYPE_CHECKING
|
|
21
21
|
from typing import Union
|
22
22
|
|
23
23
|
from sqlalchemy import cast
|
24
|
+
from sqlalchemy import Column
|
25
|
+
from sqlalchemy import MetaData
|
26
|
+
from sqlalchemy import PrimaryKeyConstraint
|
24
27
|
from sqlalchemy import schema
|
28
|
+
from sqlalchemy import String
|
29
|
+
from sqlalchemy import Table
|
25
30
|
from sqlalchemy import text
|
26
31
|
|
27
32
|
from . import _autogen
|
@@ -43,11 +48,9 @@ if TYPE_CHECKING:
|
|
43
48
|
from sqlalchemy.sql import Executable
|
44
49
|
from sqlalchemy.sql.elements import ColumnElement
|
45
50
|
from sqlalchemy.sql.elements import quoted_name
|
46
|
-
from sqlalchemy.sql.schema import Column
|
47
51
|
from sqlalchemy.sql.schema import Constraint
|
48
52
|
from sqlalchemy.sql.schema import ForeignKeyConstraint
|
49
53
|
from sqlalchemy.sql.schema import Index
|
50
|
-
from sqlalchemy.sql.schema import Table
|
51
54
|
from sqlalchemy.sql.schema import UniqueConstraint
|
52
55
|
from sqlalchemy.sql.selectable import TableClause
|
53
56
|
from sqlalchemy.sql.type_api import TypeEngine
|
@@ -136,6 +139,40 @@ class DefaultImpl(metaclass=ImplMeta):
|
|
136
139
|
self.output_buffer.write(text + "\n\n")
|
137
140
|
self.output_buffer.flush()
|
138
141
|
|
142
|
+
def version_table_impl(
|
143
|
+
self,
|
144
|
+
*,
|
145
|
+
version_table: str,
|
146
|
+
version_table_schema: Optional[str],
|
147
|
+
version_table_pk: bool,
|
148
|
+
**kw: Any,
|
149
|
+
) -> Table:
|
150
|
+
"""Generate a :class:`.Table` object which will be used as the
|
151
|
+
structure for the Alembic version table.
|
152
|
+
|
153
|
+
Third party dialects may override this hook to provide an alternate
|
154
|
+
structure for this :class:`.Table`; requirements are only that it
|
155
|
+
be named based on the ``version_table`` parameter and contains
|
156
|
+
at least a single string-holding column named ``version_num``.
|
157
|
+
|
158
|
+
.. versionadded:: 1.14
|
159
|
+
|
160
|
+
"""
|
161
|
+
vt = Table(
|
162
|
+
version_table,
|
163
|
+
MetaData(),
|
164
|
+
Column("version_num", String(32), nullable=False),
|
165
|
+
schema=version_table_schema,
|
166
|
+
)
|
167
|
+
if version_table_pk:
|
168
|
+
vt.append_constraint(
|
169
|
+
PrimaryKeyConstraint(
|
170
|
+
"version_num", name=f"{version_table}_pkc"
|
171
|
+
)
|
172
|
+
)
|
173
|
+
|
174
|
+
return vt
|
175
|
+
|
139
176
|
def requires_recreate_in_batch(
|
140
177
|
self, batch_op: BatchOperationsImpl
|
141
178
|
) -> bool:
|
@@ -362,11 +399,11 @@ class DefaultImpl(metaclass=ImplMeta):
|
|
362
399
|
base.RenameTable(old_table_name, new_table_name, schema=schema)
|
363
400
|
)
|
364
401
|
|
365
|
-
def create_table(self, table: Table) -> None:
|
402
|
+
def create_table(self, table: Table, **kw: Any) -> None:
|
366
403
|
table.dispatch.before_create(
|
367
404
|
table, self.connection, checkfirst=False, _ddl_runner=self
|
368
405
|
)
|
369
|
-
self._exec(schema.CreateTable(table))
|
406
|
+
self._exec(schema.CreateTable(table, **kw))
|
370
407
|
table.dispatch.after_create(
|
371
408
|
table, self.connection, checkfirst=False, _ddl_runner=self
|
372
409
|
)
|
@@ -385,11 +422,11 @@ class DefaultImpl(metaclass=ImplMeta):
|
|
385
422
|
if comment and with_comment:
|
386
423
|
self.create_column_comment(column)
|
387
424
|
|
388
|
-
def drop_table(self, table: Table) -> None:
|
425
|
+
def drop_table(self, table: Table, **kw: Any) -> None:
|
389
426
|
table.dispatch.before_drop(
|
390
427
|
table, self.connection, checkfirst=False, _ddl_runner=self
|
391
428
|
)
|
392
|
-
self._exec(schema.DropTable(table))
|
429
|
+
self._exec(schema.DropTable(table, **kw))
|
393
430
|
table.dispatch.after_drop(
|
394
431
|
table, self.connection, checkfirst=False, _ddl_runner=self
|
395
432
|
)
|
@@ -747,7 +747,12 @@ def create_primary_key(
|
|
747
747
|
|
748
748
|
"""
|
749
749
|
|
750
|
-
def create_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,
|
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
|
|
@@ -1175,7 +1175,11 @@ class Operations(AbstractOperations):
|
|
1175
1175
|
...
|
1176
1176
|
|
1177
1177
|
def create_table(
|
1178
|
-
self,
|
1178
|
+
self,
|
1179
|
+
table_name: str,
|
1180
|
+
*columns: SchemaItem,
|
1181
|
+
if_not_exists: Optional[bool] = None,
|
1182
|
+
**kw: Any,
|
1179
1183
|
) -> Table:
|
1180
1184
|
r"""Issue a "create table" instruction using the current migration
|
1181
1185
|
context.
|
@@ -1247,6 +1251,10 @@ class Operations(AbstractOperations):
|
|
1247
1251
|
quoting of the schema outside of the default behavior, use
|
1248
1252
|
the SQLAlchemy construct
|
1249
1253
|
:class:`~sqlalchemy.sql.elements.quoted_name`.
|
1254
|
+
:param if_not_exists: If True, adds IF NOT EXISTS operator when
|
1255
|
+
creating the new table.
|
1256
|
+
|
1257
|
+
.. versionadded:: 1.13.3
|
1250
1258
|
:param \**kw: Other keyword arguments are passed to the underlying
|
1251
1259
|
:class:`sqlalchemy.schema.Table` object created for the command.
|
1252
1260
|
|
@@ -1438,7 +1446,12 @@ class Operations(AbstractOperations):
|
|
1438
1446
|
...
|
1439
1447
|
|
1440
1448
|
def drop_table(
|
1441
|
-
self,
|
1449
|
+
self,
|
1450
|
+
table_name: str,
|
1451
|
+
*,
|
1452
|
+
schema: Optional[str] = None,
|
1453
|
+
if_exists: Optional[bool] = None,
|
1454
|
+
**kw: Any,
|
1442
1455
|
) -> None:
|
1443
1456
|
r"""Issue a "drop table" instruction using the current
|
1444
1457
|
migration context.
|
@@ -1453,6 +1466,10 @@ class Operations(AbstractOperations):
|
|
1453
1466
|
quoting of the schema outside of the default behavior, use
|
1454
1467
|
the SQLAlchemy construct
|
1455
1468
|
:class:`~sqlalchemy.sql.elements.quoted_name`.
|
1469
|
+
:param if_exists: If True, adds IF EXISTS operator when
|
1470
|
+
dropping the table.
|
1471
|
+
|
1472
|
+
.. versionadded:: 1.13.3
|
1456
1473
|
:param \**kw: Other keyword arguments are passed to the underlying
|
1457
1474
|
:class:`sqlalchemy.schema.Table` object created for the command.
|
1458
1475
|
|
@@ -1159,6 +1159,7 @@ class CreateTableOp(MigrateOperation):
|
|
1159
1159
|
columns: Sequence[SchemaItem],
|
1160
1160
|
*,
|
1161
1161
|
schema: Optional[str] = None,
|
1162
|
+
if_not_exists: Optional[bool] = None,
|
1162
1163
|
_namespace_metadata: Optional[MetaData] = None,
|
1163
1164
|
_constraints_included: bool = False,
|
1164
1165
|
**kw: Any,
|
@@ -1166,6 +1167,7 @@ class CreateTableOp(MigrateOperation):
|
|
1166
1167
|
self.table_name = table_name
|
1167
1168
|
self.columns = columns
|
1168
1169
|
self.schema = schema
|
1170
|
+
self.if_not_exists = if_not_exists
|
1169
1171
|
self.info = kw.pop("info", {})
|
1170
1172
|
self.comment = kw.pop("comment", None)
|
1171
1173
|
self.prefixes = kw.pop("prefixes", None)
|
@@ -1228,6 +1230,7 @@ class CreateTableOp(MigrateOperation):
|
|
1228
1230
|
operations: Operations,
|
1229
1231
|
table_name: str,
|
1230
1232
|
*columns: SchemaItem,
|
1233
|
+
if_not_exists: Optional[bool] = None,
|
1231
1234
|
**kw: Any,
|
1232
1235
|
) -> Table:
|
1233
1236
|
r"""Issue a "create table" instruction using the current migration
|
@@ -1300,6 +1303,10 @@ class CreateTableOp(MigrateOperation):
|
|
1300
1303
|
quoting of the schema outside of the default behavior, use
|
1301
1304
|
the SQLAlchemy construct
|
1302
1305
|
:class:`~sqlalchemy.sql.elements.quoted_name`.
|
1306
|
+
:param if_not_exists: If True, adds IF NOT EXISTS operator when
|
1307
|
+
creating the new table.
|
1308
|
+
|
1309
|
+
.. versionadded:: 1.13.3
|
1303
1310
|
:param \**kw: Other keyword arguments are passed to the underlying
|
1304
1311
|
:class:`sqlalchemy.schema.Table` object created for the command.
|
1305
1312
|
|
@@ -1307,7 +1314,7 @@ class CreateTableOp(MigrateOperation):
|
|
1307
1314
|
to the parameters given.
|
1308
1315
|
|
1309
1316
|
"""
|
1310
|
-
op = cls(table_name, columns, **kw)
|
1317
|
+
op = cls(table_name, columns, if_not_exists=if_not_exists, **kw)
|
1311
1318
|
return operations.invoke(op)
|
1312
1319
|
|
1313
1320
|
|
@@ -1320,11 +1327,13 @@ class DropTableOp(MigrateOperation):
|
|
1320
1327
|
table_name: str,
|
1321
1328
|
*,
|
1322
1329
|
schema: Optional[str] = None,
|
1330
|
+
if_exists: Optional[bool] = None,
|
1323
1331
|
table_kw: Optional[MutableMapping[Any, Any]] = None,
|
1324
1332
|
_reverse: Optional[CreateTableOp] = None,
|
1325
1333
|
) -> None:
|
1326
1334
|
self.table_name = table_name
|
1327
1335
|
self.schema = schema
|
1336
|
+
self.if_exists = if_exists
|
1328
1337
|
self.table_kw = table_kw or {}
|
1329
1338
|
self.comment = self.table_kw.pop("comment", None)
|
1330
1339
|
self.info = self.table_kw.pop("info", None)
|
@@ -1385,6 +1394,7 @@ class DropTableOp(MigrateOperation):
|
|
1385
1394
|
table_name: str,
|
1386
1395
|
*,
|
1387
1396
|
schema: Optional[str] = None,
|
1397
|
+
if_exists: Optional[bool] = None,
|
1388
1398
|
**kw: Any,
|
1389
1399
|
) -> None:
|
1390
1400
|
r"""Issue a "drop table" instruction using the current
|
@@ -1400,11 +1410,15 @@ class DropTableOp(MigrateOperation):
|
|
1400
1410
|
quoting of the schema outside of the default behavior, use
|
1401
1411
|
the SQLAlchemy construct
|
1402
1412
|
:class:`~sqlalchemy.sql.elements.quoted_name`.
|
1413
|
+
:param if_exists: If True, adds IF EXISTS operator when
|
1414
|
+
dropping the table.
|
1415
|
+
|
1416
|
+
.. versionadded:: 1.13.3
|
1403
1417
|
:param \**kw: Other keyword arguments are passed to the underlying
|
1404
1418
|
:class:`sqlalchemy.schema.Table` object created for the command.
|
1405
1419
|
|
1406
1420
|
"""
|
1407
|
-
op = cls(table_name, schema=schema, table_kw=kw)
|
1421
|
+
op = cls(table_name, schema=schema, if_exists=if_exists, table_kw=kw)
|
1408
1422
|
operations.invoke(op)
|
1409
1423
|
|
1410
1424
|
|
@@ -79,8 +79,14 @@ def alter_column(
|
|
79
79
|
|
80
80
|
@Operations.implementation_for(ops.DropTableOp)
|
81
81
|
def drop_table(operations: "Operations", operation: "ops.DropTableOp") -> None:
|
82
|
+
kw = {}
|
83
|
+
if operation.if_exists is not None:
|
84
|
+
if not sqla_14:
|
85
|
+
raise NotImplementedError("SQLAlchemy 1.4+ required")
|
86
|
+
|
87
|
+
kw["if_exists"] = operation.if_exists
|
82
88
|
operations.impl.drop_table(
|
83
|
-
operation.to_table(operations.migration_context)
|
89
|
+
operation.to_table(operations.migration_context), **kw
|
84
90
|
)
|
85
91
|
|
86
92
|
|
@@ -127,8 +133,14 @@ def drop_index(operations: "Operations", operation: "ops.DropIndexOp") -> None:
|
|
127
133
|
def create_table(
|
128
134
|
operations: "Operations", operation: "ops.CreateTableOp"
|
129
135
|
) -> "Table":
|
136
|
+
kw = {}
|
137
|
+
if operation.if_not_exists is not None:
|
138
|
+
if not sqla_14:
|
139
|
+
raise NotImplementedError("SQLAlchemy 1.4+ required")
|
140
|
+
|
141
|
+
kw["if_not_exists"] = operation.if_not_exists
|
130
142
|
table = operation.to_table(operations.migration_context)
|
131
|
-
operations.impl.create_table(table)
|
143
|
+
operations.impl.create_table(table, **kw)
|
132
144
|
return table
|
133
145
|
|
134
146
|
|
@@ -24,10 +24,6 @@ from typing import Union
|
|
24
24
|
|
25
25
|
from sqlalchemy import Column
|
26
26
|
from sqlalchemy import literal_column
|
27
|
-
from sqlalchemy import MetaData
|
28
|
-
from sqlalchemy import PrimaryKeyConstraint
|
29
|
-
from sqlalchemy import String
|
30
|
-
from sqlalchemy import Table
|
31
27
|
from sqlalchemy.engine import Engine
|
32
28
|
from sqlalchemy.engine import url as sqla_url
|
33
29
|
from sqlalchemy.engine.strategies import MockEngineStrategy
|
@@ -36,6 +32,7 @@ from .. import ddl
|
|
36
32
|
from .. import util
|
37
33
|
from ..util import sqla_compat
|
38
34
|
from ..util.compat import EncodedIO
|
35
|
+
from ..util.sqla_compat import _select
|
39
36
|
|
40
37
|
if TYPE_CHECKING:
|
41
38
|
from sqlalchemy.engine import Dialect
|
@@ -190,18 +187,6 @@ class MigrationContext:
|
|
190
187
|
self.version_table_schema = version_table_schema = opts.get(
|
191
188
|
"version_table_schema", None
|
192
189
|
)
|
193
|
-
self._version = Table(
|
194
|
-
version_table,
|
195
|
-
MetaData(),
|
196
|
-
Column("version_num", String(32), nullable=False),
|
197
|
-
schema=version_table_schema,
|
198
|
-
)
|
199
|
-
if opts.get("version_table_pk", True):
|
200
|
-
self._version.append_constraint(
|
201
|
-
PrimaryKeyConstraint(
|
202
|
-
"version_num", name="%s_pkc" % version_table
|
203
|
-
)
|
204
|
-
)
|
205
190
|
|
206
191
|
self._start_from_rev: Optional[str] = opts.get("starting_rev")
|
207
192
|
self.impl = ddl.DefaultImpl.get_by_dialect(dialect)(
|
@@ -212,6 +197,13 @@ class MigrationContext:
|
|
212
197
|
self.output_buffer,
|
213
198
|
opts,
|
214
199
|
)
|
200
|
+
|
201
|
+
self._version = self.impl.version_table_impl(
|
202
|
+
version_table=version_table,
|
203
|
+
version_table_schema=version_table_schema,
|
204
|
+
version_table_pk=opts.get("version_table_pk", True),
|
205
|
+
)
|
206
|
+
|
215
207
|
log.info("Context impl %s.", self.impl.__class__.__name__)
|
216
208
|
if self.as_sql:
|
217
209
|
log.info("Generating static SQL")
|
@@ -540,7 +532,10 @@ class MigrationContext:
|
|
540
532
|
return ()
|
541
533
|
assert self.connection is not None
|
542
534
|
return tuple(
|
543
|
-
row[0]
|
535
|
+
row[0]
|
536
|
+
for row in self.connection.execute(
|
537
|
+
_select(self._version.c.version_num)
|
538
|
+
)
|
544
539
|
)
|
545
540
|
|
546
541
|
def _ensure_version_table(self, purge: bool = False) -> None:
|
@@ -187,6 +187,7 @@ class ScriptDirectory:
|
|
187
187
|
split_on_path = {
|
188
188
|
None: None,
|
189
189
|
"space": " ",
|
190
|
+
"newline": "\n",
|
190
191
|
"os": os.pathsep,
|
191
192
|
":": ":",
|
192
193
|
";": ";",
|
@@ -200,7 +201,8 @@ class ScriptDirectory:
|
|
200
201
|
raise ValueError(
|
201
202
|
"'%s' is not a valid value for "
|
202
203
|
"version_path_separator; "
|
203
|
-
"expected 'space', 'os', ':', ';'"
|
204
|
+
"expected 'space', 'newline', 'os', ':', ';'"
|
205
|
+
% version_path_separator
|
204
206
|
) from ke
|
205
207
|
else:
|
206
208
|
if split_char is None:
|
@@ -210,7 +212,9 @@ class ScriptDirectory:
|
|
210
212
|
)
|
211
213
|
else:
|
212
214
|
version_locations = [
|
213
|
-
x
|
215
|
+
x.strip()
|
216
|
+
for x in version_locations_str.split(split_char)
|
217
|
+
if x
|
214
218
|
]
|
215
219
|
else:
|
216
220
|
version_locations = None
|
@@ -47,6 +47,7 @@ prepend_sys_path = .
|
|
47
47
|
# version_path_separator = :
|
48
48
|
# version_path_separator = ;
|
49
49
|
# version_path_separator = space
|
50
|
+
# version_path_separator = newline
|
50
51
|
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
|
51
52
|
|
52
53
|
# set to 'true' to search source files recursively
|
@@ -89,12 +90,12 @@ keys = console
|
|
89
90
|
keys = generic
|
90
91
|
|
91
92
|
[logger_root]
|
92
|
-
level =
|
93
|
+
level = WARNING
|
93
94
|
handlers = console
|
94
95
|
qualname =
|
95
96
|
|
96
97
|
[logger_sqlalchemy]
|
97
|
-
level =
|
98
|
+
level = WARNING
|
98
99
|
handlers =
|
99
100
|
qualname = sqlalchemy.engine
|
100
101
|
|
@@ -49,6 +49,7 @@ prepend_sys_path = .
|
|
49
49
|
# version_path_separator = :
|
50
50
|
# version_path_separator = ;
|
51
51
|
# version_path_separator = space
|
52
|
+
# version_path_separator = newline
|
52
53
|
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
|
53
54
|
|
54
55
|
# set to 'true' to search source files recursively
|
@@ -91,12 +92,12 @@ keys = console
|
|
91
92
|
keys = generic
|
92
93
|
|
93
94
|
[logger_root]
|
94
|
-
level =
|
95
|
+
level = WARNING
|
95
96
|
handlers = console
|
96
97
|
qualname =
|
97
98
|
|
98
99
|
[logger_sqlalchemy]
|
99
|
-
level =
|
100
|
+
level = WARNING
|
100
101
|
handlers =
|
101
102
|
qualname = sqlalchemy.engine
|
102
103
|
|
@@ -49,6 +49,7 @@ prepend_sys_path = .
|
|
49
49
|
# version_path_separator = :
|
50
50
|
# version_path_separator = ;
|
51
51
|
# version_path_separator = space
|
52
|
+
# version_path_separator = newline
|
52
53
|
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
|
53
54
|
|
54
55
|
# set to 'true' to search source files recursively
|
@@ -96,12 +97,12 @@ keys = console
|
|
96
97
|
keys = generic
|
97
98
|
|
98
99
|
[logger_root]
|
99
|
-
level =
|
100
|
+
level = WARNING
|
100
101
|
handlers = console
|
101
102
|
qualname =
|
102
103
|
|
103
104
|
[logger_sqlalchemy]
|
104
|
-
level =
|
105
|
+
level = WARNING
|
105
106
|
handlers =
|
106
107
|
qualname = sqlalchemy.engine
|
107
108
|
|
@@ -74,7 +74,9 @@ class _ErrorContainer:
|
|
74
74
|
|
75
75
|
|
76
76
|
@contextlib.contextmanager
|
77
|
-
def _expect_raises(
|
77
|
+
def _expect_raises(
|
78
|
+
except_cls, msg=None, check_context=False, text_exact=False
|
79
|
+
):
|
78
80
|
ec = _ErrorContainer()
|
79
81
|
if check_context:
|
80
82
|
are_we_already_in_a_traceback = sys.exc_info()[0]
|
@@ -85,7 +87,10 @@ def _expect_raises(except_cls, msg=None, check_context=False):
|
|
85
87
|
ec.error = err
|
86
88
|
success = True
|
87
89
|
if msg is not None:
|
88
|
-
|
90
|
+
if text_exact:
|
91
|
+
assert str(err) == msg, f"{msg} != {err}"
|
92
|
+
else:
|
93
|
+
assert re.search(msg, str(err), re.UNICODE), f"{msg} !~ {err}"
|
89
94
|
if check_context and not are_we_already_in_a_traceback:
|
90
95
|
_assert_proper_exception_context(err)
|
91
96
|
print(str(err).encode("utf-8"))
|
@@ -98,8 +103,12 @@ def expect_raises(except_cls, check_context=True):
|
|
98
103
|
return _expect_raises(except_cls, check_context=check_context)
|
99
104
|
|
100
105
|
|
101
|
-
def expect_raises_message(
|
102
|
-
|
106
|
+
def expect_raises_message(
|
107
|
+
except_cls, msg, check_context=True, text_exact=False
|
108
|
+
):
|
109
|
+
return _expect_raises(
|
110
|
+
except_cls, msg=msg, check_context=check_context, text_exact=text_exact
|
111
|
+
)
|
103
112
|
|
104
113
|
|
105
114
|
def eq_ignore_whitespace(a, b, msg=None):
|
@@ -118,7 +118,7 @@ keys = root,sqlalchemy
|
|
118
118
|
keys = console
|
119
119
|
|
120
120
|
[logger_root]
|
121
|
-
level =
|
121
|
+
level = WARNING
|
122
122
|
handlers = console
|
123
123
|
qualname =
|
124
124
|
|
@@ -171,7 +171,7 @@ keys = root
|
|
171
171
|
keys = console
|
172
172
|
|
173
173
|
[logger_root]
|
174
|
-
level =
|
174
|
+
level = WARNING
|
175
175
|
handlers = console
|
176
176
|
qualname =
|
177
177
|
|
@@ -216,7 +216,7 @@ keys = root
|
|
216
216
|
keys = console
|
217
217
|
|
218
218
|
[logger_root]
|
219
|
-
level =
|
219
|
+
level = WARNING
|
220
220
|
handlers = console
|
221
221
|
qualname =
|
222
222
|
|
@@ -497,7 +497,7 @@ keys = root
|
|
497
497
|
keys = console
|
498
498
|
|
499
499
|
[logger_root]
|
500
|
-
level =
|
500
|
+
level = WARNING
|
501
501
|
handlers = console
|
502
502
|
qualname =
|
503
503
|
|
@@ -527,7 +527,7 @@ class _textual_index_element(sql.ColumnElement):
|
|
527
527
|
self.fake_column = schema.Column(self.text.text, sqltypes.NULLTYPE)
|
528
528
|
table.append_column(self.fake_column)
|
529
529
|
|
530
|
-
def get_children(self):
|
530
|
+
def get_children(self, **kw):
|
531
531
|
return [self.fake_column]
|
532
532
|
|
533
533
|
|