fixing the db migrations

This commit is contained in:
2025-10-01 12:40:58 -07:00
parent 63b3575797
commit 7ffc57a7a8
7 changed files with 158 additions and 51 deletions

View File

@@ -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 ###