Files
cal_counter/migrations/versions/bb1d9bebf8f6_.py
Stef 66204e7e4a Add Docker, migrations, and initial database setup
Added Dockerfile and docker-compose.yaml for containerization. Introduced Alembic migrations with initial schema and a migration to alter column types. Added requirements.txt for dependencies and removed temp.py cleanup script. Updated .gitignore to allow tracking of migration files.
2025-08-11 00:49:46 +02:00

51 lines
1.4 KiB
Python

"""empty message
Revision ID: bb1d9bebf8f6
Revises: 46cd3e1a3b67
Create Date: 2025-08-07 16:49:19.511091
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bb1d9bebf8f6'
down_revision = '46cd3e1a3b67'
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('barcode',
existing_type=sa.INTEGER(),
type_=sa.String(),
existing_nullable=True)
with op.batch_alter_table('food_log', schema=None) as batch_op:
batch_op.alter_column('amount',
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_log', schema=None) as batch_op:
batch_op.alter_column('amount',
existing_type=sa.Float(),
type_=sa.INTEGER(),
existing_nullable=False)
with op.batch_alter_table('food_item', schema=None) as batch_op:
batch_op.alter_column('barcode',
existing_type=sa.String(),
type_=sa.INTEGER(),
existing_nullable=True)
# ### end Alembic commands ###