diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-06 13:34:40 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-06 14:09:04 -0500 |
commit | 3cf19f16631e54108e5f519348cba14521b7433e (patch) | |
tree | 2097dc67dfdd0dec3fb94317dde1fcf2b812f751 /alembic/autogenerate | |
parent | cd7b1a94cc90ca533a84b47332900888151e22d0 (diff) | |
download | alembic-3cf19f16631e54108e5f519348cba14521b7433e.tar.gz |
distinguish between string contraint name and defined
Take _NONE_NAME into account as a valid constraint name
and don't skip these constraints or consider them to be unnamed.
Thanks to typing this also revealed that previous batch versions
were also keying "_NONE_NAME" constraints as though they were named.
Fixed regression for 1.10.0 where :class:`.Constraint` objects were
suddenly required to have non-None name fields when using batch mode, which
was not previously a requirement.
Change-Id: If4a7191a00848b19cb124bc6da362f3bc6ce1472
Fixes: #1195
Diffstat (limited to 'alembic/autogenerate')
-rw-r--r-- | alembic/autogenerate/compare.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/alembic/autogenerate/compare.py b/alembic/autogenerate/compare.py index f50c41c..4f5126f 100644 --- a/alembic/autogenerate/compare.py +++ b/alembic/autogenerate/compare.py @@ -652,7 +652,7 @@ def _compare_indexes_and_uniques( conn_names = { c.name: c for c in conn_unique_constraints.union(conn_indexes_sig) - if sqla_compat.constraint_name_defined(c.name) + if sqla_compat.constraint_name_string(c.name) } doubled_constraints = { |