Skip to content

Commit 6de3c94

Browse files
committed
fix: change state migration file
1 parent 58abcac commit 6de3c94

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/backend/app/migrations/versions/e23c05f21542_change_task_events_state.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ def upgrade():
5555
# Step 2: Add a new column with the new enum type
5656
op.add_column("task_events", sa.Column("new_state", new_state_enum, nullable=True))
5757

58-
# Step 3: Populate the new state column with the transformed data
59-
op.execute(
60-
"""
61-
UPDATE task_events
62-
SET new_state =
63-
CASE
64-
WHEN state = 'IMAGE_PROCESSED' THEN 'IMAGE_PROCESSING_FINISHED'
65-
ELSE state::text
66-
END::state_new
67-
"""
68-
)
58+
# # Step 3: Populate the new state column with the transformed data
59+
# op.execute(
60+
# """
61+
# UPDATE task_events
62+
# SET new_state =
63+
# CASE
64+
# WHEN state = 'IMAGE_PROCESSED' THEN 'IMAGE_PROCESSING_FINISHED'
65+
# ELSE state::text
66+
# END::state_new
67+
# """
68+
# )
6969

7070
# Step 4: Drop the old state column
7171
op.drop_column("task_events", "state")
@@ -110,17 +110,17 @@ def downgrade():
110110
# Step 3: Add the old state column with the old enum type
111111
op.add_column("task_events", sa.Column("state_old", old_state_enum, nullable=True))
112112

113-
# Step 4: Populate the old state column with the transformed data
114-
op.execute(
115-
"""
116-
UPDATE task_events
117-
SET state_old =
118-
CASE
119-
WHEN state = 'IMAGE_PROCESSING_FINISHED' THEN 'IMAGE_PROCESSED'
120-
ELSE state::text
121-
END::state
122-
"""
123-
)
113+
# # Step 4: Populate the old state column with the transformed data
114+
# op.execute(
115+
# """
116+
# UPDATE task_events
117+
# SET state_old =
118+
# CASE
119+
# WHEN state = 'IMAGE_PROCESSING_FINISHED' THEN 'IMAGE_PROCESSED'
120+
# ELSE state::text
121+
# END::state
122+
# """
123+
# )
124124

125125
# Step 5: Drop the new_state column
126126
op.drop_column("task_events", "state")

0 commit comments

Comments
 (0)