Skip to content

Commit 2602ea6

Browse files
fix migration
1 parent 04b0999 commit 2602ea6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

carrot/db/migrations/versions/4acbbaffde7f_.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ def upgrade() -> None:
3232
"auction",
3333
["product_id"],
3434
)
35-
op.add_column('product', sa.Column('image_ids', sa.JSON(), nullable=False))
35+
columns = [c['name'] for c in insp.get_columns('product')]
36+
if 'image_ids' not in columns:
37+
op.add_column('product', sa.Column('image_ids', sa.JSON(), nullable=False))
38+
else:
39+
# 이미 있다면 로깅하거나 그냥 넘어갑니다.
40+
print("Column 'image_ids' already exists, skipping.")
3641
# ### end Alembic commands ###
3742

3843

0 commit comments

Comments
 (0)