Files
cal_counter/migrations/versions/dea130d45cec_.py
Stef 4d34049850 Change energy_100 column type to Float in food_item
This migration alters the 'energy_100' column in the 'food_item' table from INTEGER to Float to allow for decimal values. The downgrade reverses this change.
2025-08-11 16:52:57 +02:00

39 lines
995 B
Python

"""empty message
Revision ID: dea130d45cec
Revises: f5fbbe915d51
Create Date: 2025-08-11 16:51:55.485569
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dea130d45cec'
down_revision = 'f5fbbe915d51'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('food_item', schema=None) as batch_op:
batch_op.alter_column('energy_100',
existing_type=sa.INTEGER(),
type_=sa.Float(),
existing_nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('food_item', schema=None) as batch_op:
batch_op.alter_column('energy_100',
existing_type=sa.Float(),
type_=sa.INTEGER(),
existing_nullable=False)
# ### end Alembic commands ###