Skip to content

Commit 3dccdf9

Browse files
committed
fix: Migration error message
1 parent 2682797 commit 3dccdf9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/migrations/versions/1d3c1e2061f6_datetime_in_planner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ def upgrade():
6363

6464
with op.batch_alter_table('planner', schema=None) as batch_op:
6565
batch_op.alter_column('cooking_date', nullable=False)
66-
batch_op.drop_column('day')
66+
batch_op.drop_constraint('pk_planner')
6767
batch_op.create_primary_key('pk_planner', ['recipe_id', 'cooking_date'])
68+
batch_op.drop_column('day')
6869

6970
# ### end Alembic commands ###
7071

@@ -73,7 +74,8 @@ def downgrade():
7374
# ### commands auto generated by Alembic - please adjust! ###
7475
with op.batch_alter_table('planner', schema=None) as batch_op:
7576
batch_op.add_column(sa.Column('day', sa.INTEGER(), nullable=False))
76-
batch_op.drop_column('cooking_date')
77+
batch_op.drop_constraint('pk_planner')
7778
batch_op.create_primary_key('pk_planner', ['recipe_id', 'day'])
79+
batch_op.drop_column('cooking_date')
7880

7981
# ### end Alembic commands ###

0 commit comments

Comments
 (0)