48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
"""empty message
|
|
|
|
Revision ID: 3d0cab7d7747
|
|
Revises: c28b3a6cdc3a
|
|
Create Date: 2023-02-25 15:37:19.626908
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '3d0cab7d7747'
|
|
down_revision = 'c28b3a6cdc3a'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('recipes',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.String(length=128), nullable=False),
|
|
sa.Column('notes', sa.String(), nullable=True),
|
|
sa.Column('createdAt', sa.DateTime(), nullable=True),
|
|
sa.Column('modifiedAt', sa.DateTime(), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table('recipe_entries',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('recipe_id', sa.Integer(), nullable=False),
|
|
sa.Column('product_id', sa.Integer(), nullable=False),
|
|
sa.Column('quantity', sa.String(length=128), nullable=True),
|
|
sa.Column('notes', sa.String(), nullable=True),
|
|
sa.Column('createdAt', sa.DateTime(), nullable=True),
|
|
sa.Column('modifiedAt', sa.DateTime(), nullable=True),
|
|
sa.ForeignKeyConstraint(['product_id'], ['products.id'], ),
|
|
sa.ForeignKeyConstraint(['recipe_id'], ['recipes.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('recipe_entries')
|
|
op.drop_table('recipes')
|
|
# ### end Alembic commands ###
|