mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
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.
This commit is contained in:
50
migrations/versions/bb1d9bebf8f6_.py
Normal file
50
migrations/versions/bb1d9bebf8f6_.py
Normal file
@@ -0,0 +1,50 @@
|
||||
"""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 ###
|
||||
Reference in New Issue
Block a user