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.
- {alembic-1.13.1 → alembic-1.13.3}/LICENSE +2 -2
- {alembic-1.13.1 → alembic-1.13.3}/PKG-INFO +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/alembic/__init__.py +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/api.py +3 -3
- {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/compare.py +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/render.py +36 -15
- {alembic-1.13.1 → alembic-1.13.3}/alembic/command.py +24 -15
- {alembic-1.13.1 → alembic-1.13.3}/alembic/config.py +5 -10
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/_autogen.py +15 -11
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/base.py +5 -4
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/impl.py +26 -21
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/mysql.py +49 -31
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/oracle.py +5 -3
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/postgresql.py +2 -1
- {alembic-1.13.1 → alembic-1.13.3}/alembic/op.pyi +19 -2
- {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/base.py +24 -10
- {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/ops.py +21 -7
- {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/schemaobj.py +6 -4
- {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/toimpl.py +14 -2
- {alembic-1.13.1 → alembic-1.13.3}/alembic/runtime/environment.py +5 -7
- {alembic-1.13.1 → alembic-1.13.3}/alembic/runtime/migration.py +9 -9
- {alembic-1.13.1 → alembic-1.13.3}/alembic/script/base.py +17 -11
- {alembic-1.13.1 → alembic-1.13.3}/alembic/script/revision.py +25 -18
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/alembic.ini.mako +4 -3
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/alembic.ini.mako +3 -2
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/alembic.ini.mako +3 -2
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/assertions.py +13 -4
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/fixtures.py +20 -8
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_computed.py +1 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_environment.py +3 -3
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/langhelpers.py +3 -6
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/messaging.py +9 -3
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/sqla_compat.py +3 -5
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/PKG-INFO +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/SOURCES.txt +36 -35
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/autogenerate.rst +8 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/changelog.rst +87 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/cookbook.rst +36 -17
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/front.rst +1 -1
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/tutorial.rst +1 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/basic.css +2 -2
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/doctools.js +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/documentation_options.js +2 -2
- alembic-1.13.3/docs/_static/images/logo_colab.png +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/language_data.js +2 -2
- alembic-1.13.3/docs/_static/pygments.css +152 -0
- alembic-1.13.3/docs/_static/sbt-webpack-macros.html +11 -0
- alembic-1.13.3/docs/_static/scripts/bootstrap.js +3 -0
- alembic-1.13.3/docs/_static/scripts/bootstrap.js.LICENSE.txt +5 -0
- alembic-1.13.3/docs/_static/scripts/pydata-sphinx-theme.js +2 -0
- alembic-1.13.3/docs/_static/scripts/sphinx-book-theme.js +2 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/searchtools.js +108 -62
- alembic-1.13.3/docs/_static/styles/bootstrap.css +6 -0
- alembic-1.13.3/docs/_static/styles/pydata-sphinx-theme.css +2 -0
- alembic-1.13.3/docs/_static/styles/sphinx-book-theme.css +9 -0
- alembic-1.13.3/docs/_static/styles/theme.css +2 -0
- alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/LICENSE.txt +165 -0
- alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/css/all.min.css +5 -0
- alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/js/all.min.js +2 -0
- alembic-1.13.3/docs/_static/vendor/fontawesome/6.5.2/js/all.min.js.LICENSE.txt +5 -0
- alembic-1.13.3/docs/_static/webpack-macros.html +31 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/autogenerate.html +530 -142
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/commands.html +502 -133
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/config.html +487 -121
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/ddl.html +923 -397
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/index.html +416 -80
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/operations.html +669 -217
- alembic-1.13.3/docs/api/overview.html +497 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/runtime.html +538 -151
- {alembic-1.13.1 → alembic-1.13.3}/docs/api/script.html +590 -183
- {alembic-1.13.1 → alembic-1.13.3}/docs/autogenerate.html +499 -119
- {alembic-1.13.1 → alembic-1.13.3}/docs/batch.html +466 -105
- {alembic-1.13.1 → alembic-1.13.3}/docs/branches.html +474 -109
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/Makefile +1 -1
- alembic-1.13.1/docs/_sources/autogenerate.rst.txt → alembic-1.13.3/docs/build/autogenerate.rst +8 -0
- alembic-1.13.1/docs/_sources/changelog.rst.txt → alembic-1.13.3/docs/build/changelog.rst +87 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/conf.py +31 -10
- alembic-1.13.1/docs/_sources/cookbook.rst.txt → alembic-1.13.3/docs/build/cookbook.rst +36 -17
- alembic-1.13.1/docs/_sources/front.rst.txt → alembic-1.13.3/docs/build/front.rst +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/requirements.txt +3 -0
- alembic-1.13.1/docs/_sources/tutorial.rst.txt → alembic-1.13.3/docs/build/tutorial.rst +1 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/changelog.html +1725 -715
- {alembic-1.13.1 → alembic-1.13.3}/docs/cookbook.html +549 -152
- alembic-1.13.3/docs/front.html +583 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/genindex.html +373 -65
- {alembic-1.13.1 → alembic-1.13.3}/docs/index.html +445 -80
- {alembic-1.13.1 → alembic-1.13.3}/docs/naming.html +443 -91
- {alembic-1.13.1 → alembic-1.13.3}/docs/offline.html +446 -93
- {alembic-1.13.1 → alembic-1.13.3}/docs/ops.html +590 -178
- alembic-1.13.3/docs/py-modindex.html +475 -0
- alembic-1.13.3/docs/search.html +392 -0
- alembic-1.13.3/docs/searchindex.js +1 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/tutorial.html +478 -113
- {alembic-1.13.1 → alembic-1.13.3}/pyproject.toml +11 -1
- {alembic-1.13.1 → alembic-1.13.3}/setup.cfg +2 -10
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_diffs.py +1 -98
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_indexes.py +5 -4
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_render.py +62 -1
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_batch.py +14 -12
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_command.py +7 -14
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_config.py +9 -2
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_impl.py +27 -0
- alembic-1.13.3/tests/test_messaging.py +30 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_mssql.py +4 -3
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_op.py +20 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_postgresql.py +28 -16
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_script_production.py +1 -1
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_version_traversal.py +0 -2
- {alembic-1.13.1 → alembic-1.13.3}/tox.ini +4 -4
- alembic-1.13.1/.coveragerc +0 -5
- alembic-1.13.1/.github/FUNDING.yml +0 -6
- alembic-1.13.1/.github/ISSUE_TEMPLATE/bug_report.md +0 -41
- alembic-1.13.1/.github/ISSUE_TEMPLATE/config.yml +0 -15
- alembic-1.13.1/.github/ISSUE_TEMPLATE/use_case.md +0 -24
- alembic-1.13.1/.github/pull_request_template.md +0 -27
- alembic-1.13.1/.github/workflows/run-on-pr.yaml +0 -85
- alembic-1.13.1/.github/workflows/run-test.yaml +0 -100
- alembic-1.13.1/.gitignore +0 -24
- alembic-1.13.1/.gitreview +0 -6
- alembic-1.13.1/.pre-commit-config.yaml +0 -31
- alembic-1.13.1/docs/_static/nature.css +0 -252
- alembic-1.13.1/docs/_static/pygments.css +0 -75
- alembic-1.13.1/docs/api/overview.html +0 -163
- alembic-1.13.1/docs/build/assets/api_overview.graffle +0 -2795
- alembic-1.13.1/docs/build/make.bat +0 -113
- alembic-1.13.1/docs/front.html +0 -225
- alembic-1.13.1/docs/py-modindex.html +0 -181
- alembic-1.13.1/docs/search.html +0 -105
- alembic-1.13.1/docs/searchindex.js +0 -1
- alembic-1.13.1/reap_dbs.py +0 -25
- {alembic-1.13.1 → alembic-1.13.3}/CHANGES +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/MANIFEST.in +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/README.rst +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/README.unittests.rst +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/__main__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/autogenerate/rewriter.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/context.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/context.pyi +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/mssql.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/ddl/sqlite.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/environment.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/migration.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/op.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/operations/batch.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/py.typed +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/runtime/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/script/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/script/write_hooks.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/README +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/env.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/async/script.py.mako +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/README +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/env.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/generic/script.py.mako +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/README +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/env.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/templates/multidb/script.py.mako +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/env.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/plugin/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/plugin/bootstrap.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/requirements.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/schemacompare.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/_autogen_fixtures.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_comments.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_diffs.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_fks.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_autogen_identity.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/suite/test_op.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/util.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/testing/warnings.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/compat.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/editor.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/exc.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic/util/pyfiles.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/dependency_links.txt +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/entry_points.txt +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/not-zip-safe +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/requires.txt +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/alembic.egg-info/top_level.txt +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_images/api_overview.png +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/autogenerate.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/commands.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/config.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/ddl.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/index.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/operations.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/overview.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/runtime.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/api/script.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/batch.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/branches.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/index.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/naming.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/offline.rst +0 -0
- {alembic-1.13.1/docs/build → alembic-1.13.3/docs/_sources}/ops.rst +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/changelog.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/clipboard.min.js +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/copybutton.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/copybutton.js +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/copybutton_funcs.js +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/file.png +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/minus.png +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/nature_override.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/plus.png +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/site_custom_css.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/sphinx_highlight.js +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/_static/sphinx_paramlinks.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/_static/nature_override.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/_static/site_custom_css.css +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/_templates/site_custom_sidebars.html +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/api/api_overview.png +0 -0
- /alembic-1.13.1/docs/_sources/api/autogenerate.rst.txt → /alembic-1.13.3/docs/build/api/autogenerate.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/commands.rst.txt → /alembic-1.13.3/docs/build/api/commands.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/config.rst.txt → /alembic-1.13.3/docs/build/api/config.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/ddl.rst.txt → /alembic-1.13.3/docs/build/api/ddl.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/index.rst.txt → /alembic-1.13.3/docs/build/api/index.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/operations.rst.txt → /alembic-1.13.3/docs/build/api/operations.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/overview.rst.txt → /alembic-1.13.3/docs/build/api/overview.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/runtime.rst.txt → /alembic-1.13.3/docs/build/api/runtime.rst +0 -0
- /alembic-1.13.1/docs/_sources/api/script.rst.txt → /alembic-1.13.3/docs/build/api/script.rst +0 -0
- /alembic-1.13.1/docs/_sources/batch.rst.txt → /alembic-1.13.3/docs/build/batch.rst +0 -0
- /alembic-1.13.1/docs/_sources/branches.rst.txt → /alembic-1.13.3/docs/build/branches.rst +0 -0
- /alembic-1.13.1/docs/_sources/index.rst.txt → /alembic-1.13.3/docs/build/index.rst +0 -0
- /alembic-1.13.1/docs/_sources/naming.rst.txt → /alembic-1.13.3/docs/build/naming.rst +0 -0
- /alembic-1.13.1/docs/_sources/offline.rst.txt → /alembic-1.13.3/docs/build/offline.rst +0 -0
- /alembic-1.13.1/docs/_sources/ops.rst.txt → /alembic-1.13.3/docs/build/ops.rst +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/docs/build/unreleased/README.txt +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/setup.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/__init__.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/_large_map.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/conftest.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/requirements.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_autogen_composition.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_bulk_insert.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_editor.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_environment.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_external_dialect.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_mysql.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_offline_environment.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_op_naming_convention.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_oracle.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_post_write.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_revision.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_script_consumption.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_sqlite.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_stubs.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_suite.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tests/test_version_table.py +0 -0
- {alembic-1.13.1 → alembic-1.13.3}/tools/write_pyi.py +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright 2009-
|
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.
|
@@ -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
|
-
|
601
|
-
|
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(
|
@@ -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=
|
191
|
-
|
192
|
-
|
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=
|
220
|
-
|
221
|
-
|
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": (
|
332
|
-
|
333
|
-
|
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
|
-
|
596
|
-
|
597
|
-
|
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":
|
1079
|
-
|
1080
|
-
|
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
|
318
|
+
:param revisions: The revisions to merge.
|
319
319
|
|
320
|
-
:param
|
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
|
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(
|
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
|
-
(
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
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
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
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
|
-
|
242
|
-
|
243
|
-
|
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[
|
172
|
-
multiparams: Sequence[
|
173
|
-
params:
|
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
|
-
|
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
|
-
|
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:
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
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=
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
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=
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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=
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
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=
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
372
|
-
|
373
|
-
|
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
|
-
|
145
|
-
|
146
|
-
|
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
|
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(
|
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
|
|