]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Copy column that's already attached
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Nov 2020 13:22:18 +0000 (08:22 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Nov 2020 13:22:18 +0000 (08:22 -0500)
commita41d5e604fbea1e4c1723db9b826b394c702e34b
tree0c3cc336e92949cf08cd14684bf6ec1937fa57d7
parent9a11c3595aa82e82e3ca2a819a8dda8caf7a0440
Copy column that's already attached

Modified the ``add_column()`` operation such that the ``Column`` object in
use is shallow copied to a new instance if that ``Column`` is already
attached to a ``table()`` or ``Table``. This accommodates for the change
made in SQLAlchemy issue #5618 which prohibits a ``Column`` from being
associated with multiple ``table()`` objects. This resumes support for
using a ``Column`` inside of an Alembic operation that already refers to a
parent ``table()`` or ``Table`` as well as allows operation objects just
autogenerated to work.

Change-Id: Idc6933cf0da40373f4f270d75883995822c072f0
Fixes: #753
alembic/operations/toimpl.py
docs/build/unreleased/753.rst [new file with mode: 0644]
tests/test_op.py