From a7902f37fe5fd11eadf2360a196431ac7290b9d7 Mon Sep 17 00:00:00 2001 From: Niraj Adhikari Date: Wed, 15 Jan 2025 16:56:20 +0545 Subject: [PATCH] fix: migration --- .../f78cde896334_image_processing_status.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/backend/app/migrations/versions/f78cde896334_image_processing_status.py b/src/backend/app/migrations/versions/f78cde896334_image_processing_status.py index 94c79084..ecc260ff 100644 --- a/src/backend/app/migrations/versions/f78cde896334_image_processing_status.py +++ b/src/backend/app/migrations/versions/f78cde896334_image_processing_status.py @@ -20,6 +20,18 @@ def upgrade() -> None: + # Create the enum type in the database + image_processing_status_enum = sa.Enum( + "NOT_STARTED", + "PROCESSING", + "SUCCESS", + "FAILED", + name="imageprocessingstatus", + ) + image_processing_status_enum.create( + op.get_bind() + ) # Bind the enum type to the database + # ### commands auto generated by Alembic - please adjust! ### op.add_column( "projects", @@ -43,4 +55,15 @@ def upgrade() -> None: def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column("projects", "image_processing_status") + + # Drop the enum type from the database + image_processing_status_enum = sa.Enum( + "NOT_STARTED", + "PROCESSING", + "SUCCESS", + "FAILED", + name="imageprocessingstatus", + ) + image_processing_status_enum.drop(op.get_bind()) # Drop the enum type + # ### end Alembic commands ###