mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
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.
51 lines
1.4 KiB
Python
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 ###
|