"""Create ingredient table

Revision ID: a3d4659850d8
Revises: 6883a964268d
Create Date: 2021-02-04 11:47:44.347679

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a3d4659850d8'
down_revision = '6883a964268d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    ingredient_table = op.create_table('ingredients',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('price', sa.Float(), nullable=True),
    sa.Column('picture', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###

    op.bulk_insert(ingredient_table,[
        {"user_id":1, "name": "lettuce", "price":.25, "picture":None},
        {"user_id":1, "name": "bun", "price":.50, "picture":None},
        {"user_id":1, "name": "patty", "price":3.25, "picture":None},
        {"user_id":1, "name": "pickle", "price":.75, "picture":None},
        {"user_id":1, "name": "tomato", "price":.50, "picture":None},
        {"user_id":1, "name": "bacon", "price":1.75, "picture":None},
        {"user_id":1, "name": "beer", "price":4.00, "picture":None},
        {"user_id":1, "name": "chicken", "price":3.75, "picture":None},
        {"user_id":1, "name": "coke", "price":2.00, "picture":None}
    ])


    # ingredients1 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =1,
    #     name = 'lettuce',
    #     price = 00.25,
    #     picture = None
    # )

    # ingredients2 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =1,
    #     name = 'Bun',
    #     price = 00.50,
    #     picture = None
    # )

    # ingredients3 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =1,
    #     name = 'Patty',
    #     price = 03.25,
    #     picture = None
    # )

    # ingredients4 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =1,
    #     name = 'Pickle',
    #     price = 00.75,
    #     picture = None
    # )

    # ingredients5 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =1,
    #     name = 'Tomato',
    #     price = 00.50,
    #     picture = None
    # )

    # ingredients6 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =1,
    #     name = 'Bacon',
    #     price = 01.75,
    #     picture = None
    # )
    # ingredients7 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =2,
    #     name = 'Beer',
    #     price = 04.00,
    #     picture = None
    # )
    # ingredients8 = Ingredient(
    #     user_id = 1,
    #     # food_or_drink_id =3,
    #     name = 'Chicken',
    #     price = 03.75,
    #     picture = None
    # )
    # ingredients9 = Ingredient(
    #     user_id =1,
    #     name = "Coke",
    #     price = 2.00,
    #     # food_or_drink_id = 4,
    #     picture = None
    # )


def downgrade():
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_table('ingredients')
    # ### end Alembic commands ###
