mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 11:11:36 +00:00
fixing the db migrations
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""Change Food.serving_size to Float and Pydantic models
|
||||
|
||||
Revision ID: 2295851db11e
|
||||
Revises: cf94fca21104
|
||||
Create Date: 2025-10-01 11:24:54.801648
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2295851db11e'
|
||||
down_revision = 'cf94fca21104'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('foods', schema=None) as batch_op:
|
||||
batch_op.alter_column('serving_size',
|
||||
existing_type=sa.VARCHAR(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=True)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('foods', schema=None) as batch_op:
|
||||
batch_op.alter_column('serving_size',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.VARCHAR(),
|
||||
existing_nullable=True)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user