Skip to content

Commit fe01932

Browse files
authored
fix: migration (#439)
1 parent c82d6a0 commit fe01932

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: src/backend/app/migrations/versions/f78cde896334_image_processing_status.py

+23
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020

2121

2222
def upgrade() -> None:
23+
# Create the enum type in the database
24+
image_processing_status_enum = sa.Enum(
25+
"NOT_STARTED",
26+
"PROCESSING",
27+
"SUCCESS",
28+
"FAILED",
29+
name="imageprocessingstatus",
30+
)
31+
image_processing_status_enum.create(
32+
op.get_bind()
33+
) # Bind the enum type to the database
34+
2335
# ### commands auto generated by Alembic - please adjust! ###
2436
op.add_column(
2537
"projects",
@@ -43,4 +55,15 @@ def upgrade() -> None:
4355
def downgrade() -> None:
4456
# ### commands auto generated by Alembic - please adjust! ###
4557
op.drop_column("projects", "image_processing_status")
58+
59+
# Drop the enum type from the database
60+
image_processing_status_enum = sa.Enum(
61+
"NOT_STARTED",
62+
"PROCESSING",
63+
"SUCCESS",
64+
"FAILED",
65+
name="imageprocessingstatus",
66+
)
67+
image_processing_status_enum.drop(op.get_bind()) # Drop the enum type
68+
4669
# ### end Alembic commands ###

0 commit comments

Comments
 (0)