You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
that is, without "key='x'" in the columns, but the constraints refer to the .key names. We should not render "key='x'" though, because the ForeignKeyConstraint will generate in DDL as referring to 't1.id', which does not exist, because operations._ensure_table_for_fk has no idea that 't1' has a different name than 'id' that's stated directly in the constraint.
The text was updated successfully, but these errors were encountered:
The rendering of a :class:~sqlalchemy.schema.ForeignKeyConstraint
will now ensure that the names of the source and target columns are
the database-side name of each column, and not the value of the .key attribute as may be set only on the Python side.
This is because Alembic generates the DDL for constraints
as standalone objects without the need to actually refer to an in-Python
:class:~sqlalchemy.schema.Table object, so there's no step that
would resolve these Python-only key names to database column names.
fixes autogen erroneously gens constraints using column.key, but we don't render "key =" in Column #259
Migrated issue, originally created by Michael Bayer (@zzzeek)
given:
alembic autogens incorrectly as:
that is, without "key='x'" in the columns, but the constraints refer to the .key names. We should not render "key='x'" though, because the ForeignKeyConstraint will generate in DDL as referring to 't1.id', which does not exist, because operations._ensure_table_for_fk has no idea that 't1' has a different name than 'id' that's stated directly in the constraint.
The text was updated successfully, but these errors were encountered: