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
When creating a non-primary key column with a sequence in postgres, alembic generates the migration as expected. However, after applying that migration, and then autogenerating a new revision, alembic sees that there is a ::regclass cast on the nextval() call, and tries to remove it in a migration.
Expected behavior
Alembic doesn't attempt to remove the ::regclass cast as it's added by postgres.
To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.
I found this code which seems to handle ::regclass, however based on the log.info below I am assuming this only handles serial primary key sequences, but I may be wrong. Have a nice day!
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating a non-primary key column with a sequence in postgres, alembic generates the migration as expected. However, after applying that migration, and then autogenerating a new revision, alembic sees that there is a
::regclass
cast on thenextval()
call, and tries to remove it in a migration.Expected behavior
Alembic doesn't attempt to remove the
::regclass
cast as it's added by postgres.To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.
Model:
Initial migration:
Every subseqent migration:
Versions.
Additional context
I found this code which seems to handle
::regclass
, however based on thelog.info
below I am assuming this only handles serial primary key sequences, but I may be wrong.Have a nice day!
The text was updated successfully, but these errors were encountered: