]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Support explicit column ordering in batch mode
authorMarcin Szymanski <ms32035@gmail.com>
Fri, 31 Jan 2020 01:36:15 +0000 (20:36 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 4 Feb 2020 19:20:49 +0000 (14:20 -0500)
commita4eba575d896a9c3af2cfbc11c9fc9e2e75a2892
tree4235a183ee9a0d05e6533bca2357d5a8109bbeb0
parent3ddf82e1e2b4fff47edbd45dd493e6bbd5880496
Support explicit column ordering in batch mode

Added new parameters :paramref:`.BatchOperations.add_column.insert_before`,
:paramref:`.BatchOperations.add_column.insert_after` which provide for
establishing the specific position in which a new column should be placed.
Also added :paramref:`.Operations.batch_alter_table.partial_reordering`
which allows the complete set of columns to be reordered when the new table
is created.   Both operations apply only to when batch mode is recreating
the whole table using ``recreate="always"``.  Thanks to Marcin Szymanski
for assistance with the implementation.

Co-Authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #640
Closes: #646
Pull-request: https://github.com/sqlalchemy/alembic/pull/646
Pull-request-sha: 29392b796dd995fabdabe50e8725385dbe1b4883

Change-Id: Iec9942baa08da4a7fc49b69093e84785fea3cec2
alembic/operations/base.py
alembic/operations/batch.py
alembic/operations/ops.py
alembic/operations/toimpl.py
docs/build/unreleased/640.rst [new file with mode: 0644]
tests/test_batch.py