I have a new migration using alembic. My database has a enum name myenum
.
This is the migration script:
def upgrade():
op.create_table(
"test_table",
# ...
sa.Column("enum_col", sa.Enum("A", "B", "C", name="myenum"), server_default="A", nullable=False)
# ...
)
But when I migrate the script, it excepts:
DuplicateObject: "myenum" already exists
I need to know how to use the existing enum in migration.
I've tried create_type=False
as shown in the answer here. But It doesn't help either.