Skip to content

Commit

Permalink
fix: migration
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Jan 15, 2025
1 parent 7c720c1 commit a7902f3
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 ###

0 comments on commit a7902f3

Please sign in to comment.