-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding an enum db type doesn't seem to add the requisite op.drop_type() in downgrade #114
Comments
the alembic autogenerate code was apparently only detecting when a new enum type was added when creating a table but not when a column with new enum was added to an existing table this adds support for detecting that this also drops the type when a column is removed with that type or a table is dropped also fixes #114 where adding a new enum type didn't have the op.drop_type since we explicitly handle the type being created and add op.add_enum_type() before the enum is used
turns out this is intentional based on how the
|
the alembic autogenerate code was apparently only detecting when a new enum type was added when creating a table but not when a column with new enum was added to an existing table this adds support for detecting that this also drops the type when a column is removed with that type or a table is dropped also fixes #114 where adding a new enum type didn't have the op.drop_type since we explicitly handle the type being created and add op.add_enum_type() before the enum is used
^ didn't work. probably/maybe because of how alembic calls the create types in autogenerate mode which is different from what the comment said. So fixed in #117 to explicitly create/drop types and not depend on the table |
* detect enum type added when a new column is added the alembic autogenerate code was apparently only detecting when a new enum type was added when creating a table but not when a column with new enum was added to an existing table this adds support for detecting that this also drops the type when a column is removed with that type or a table is dropped also fixes #114 where adding a new enum type didn't have the op.drop_type since we explicitly handle the type being created and add op.add_enum_type() before the enum is used * cleanup * use postgresql enum + change the rendering to use create_type=False when rendering the enum so that we don't get the create type and we handle both the create type and the drop type * .
adding an enum e.g. rainbow_type in tests at #113
generates the following code:
there's no explicit create type but the type is created.
however, since no explicit create type, there ends up not being a drop type either
The text was updated successfully, but these errors were encountered: