]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Accommodate SQLAlchemy 1.4/2.0
authorCaselIT <cfederico87@gmail.com>
Mon, 19 Oct 2020 21:23:08 +0000 (23:23 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 12 Jan 2021 04:41:43 +0000 (23:41 -0500)
commit365283aac593698fa483b54554f9443db3fe4933
tree08cfa15232ef2e63b444d506f5750a704f97901e
parentebc1ea35b127bd56c48dcae43d226471fd6bf6c0
Accommodate SQLAlchemy 1.4/2.0

To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer
assumes that the SQLAlchemy Connection will autocommit an individual
operation.   This essentially means that for databases that use
non-transactional DDL (pysqlite current driver behavior, MySQL), there is
still a BEGIN/COMMIT block that will surround each individual migration.
Databases that support transactional DDL should continue to have the
same flow, either per migration or per-entire run, depending on the
value of the :paramref:`.Environment.configure.transaction_per_migration`
flag.

Compatibility is established such that the entire library should
not generate any SQLAlchemy 2.0 deprecation warnings and
SQLALCHEMY_WARN_20 is part of conftest.py. (one warning remains
for the moment that needs to be resolved on the SQLAlchemy side)

The test suite requires SQLAlchemy 1.4.0b2 for testing 1.4;
1.4.0b1 won't work.

Test suite / setup also being modernized, as we are at
SQLAlchemy 1.3 we can now remove the majority of the testing
suite plugin.

Change-Id: If55b1ea3c12ead66405ab3fadc76d15d89dabb90
42 files changed:
alembic/autogenerate/api.py
alembic/ddl/impl.py
alembic/operations/batch.py
alembic/operations/schemaobj.py
alembic/runtime/migration.py
alembic/script/base.py
alembic/script/revision.py
alembic/script/write_hooks.py
alembic/testing/__init__.py
alembic/testing/assertions.py
alembic/testing/env.py
alembic/testing/fixture_functions.py [deleted file]
alembic/testing/fixtures.py
alembic/testing/plugin/bootstrap.py
alembic/testing/plugin/plugin_base.py [deleted file]
alembic/testing/plugin/pytestplugin.py [deleted file]
alembic/testing/requirements.py
alembic/testing/util.py
alembic/testing/warnings.py [new file with mode: 0644]
alembic/util/__init__.py
alembic/util/compat.py
alembic/util/langhelpers.py
alembic/util/pyfiles.py
alembic/util/sqla_compat.py
docs/build/autogenerate.rst
docs/build/unreleased/autocommit.rst [new file with mode: 0644]
setup.cfg
setup.py
tests/conftest.py
tests/requirements.py
tests/test_autogen_indexes.py
tests/test_batch.py
tests/test_bulk_insert.py
tests/test_command.py
tests/test_environment.py
tests/test_impl.py [new file with mode: 0644]
tests/test_mysql.py
tests/test_postgresql.py
tests/test_script_consumption.py
tests/test_sqlite.py
tests/test_version_table.py
tox.ini