]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Memoize elements in rewriter; use correct iteration
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Sep 2019 01:47:27 +0000 (21:47 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Sep 2019 01:47:27 +0000 (21:47 -0400)
commitb6a4e7dd8f9eb274e6420f8385ab91dc09cc27e7
tree36f980be2d16f2557c226ea57c93c1de4cb0750c
parent3398e6b5a5175009c9d7047df0c1bbf9891c6610
Memoize elements in rewriter; use correct iteration

Modified the logic of the :class:`.Rewriter` object such that it keeps a
memoization of which directives it has processed, so that it can ensure it
processes a particular directive only once, and additionally fixed
:class:`.Rewriter` so that it functions correctly for multiple-pass
autogenerate schemes, such as the one illustrated in the "multidb"
template.  By tracking which directives have been processed, a
multiple-pass scheme which calls upon the :class:`.Rewriter` multiple times
for the same structure as elements are added can work without running
duplicate operations on the same elements more than once.

Change-Id: I2cef13d51912f9d86ddd99b60e4d5b96dbf680ff
Fixes: #505
alembic/autogenerate/rewriter.py
alembic/command.py
alembic/operations/ops.py
docs/build/unreleased/505.rst [new file with mode: 0644]
tests/test_script_production.py