"""empty message

Revision ID: 93c6960790f3
Revises: 
Create Date: 2021-02-25 14:52:00.174430

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '93c6960790f3'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('contact',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=120), nullable=False),
    sa.Column('name', sa.String(length=120), nullable=False),
    sa.Column('last_name', sa.String(length=120), nullable=False),
    sa.Column('username', sa.String(length=20), nullable=False),
    sa.Column('password_hash', sa.String(length=250), nullable=True),
    sa.Column('salt', sa.String(length=16), nullable=False),
    sa.Column('status', sa.Boolean(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('username')
    )
    op.create_table('ingredient',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=120), nullable=False),
    sa.Column('category', sa.String(length=120), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('recipe',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('description', sa.String(length=5000), nullable=False),
    sa.Column('name', sa.String(length=120), nullable=False),
    sa.Column('instructions', sa.String(length=8000), nullable=False),
    sa.Column('tags', sa.String(length=250), nullable=False),
    sa.Column('likes', sa.Integer(), nullable=True),
    sa.Column('score', sa.Integer(), nullable=True),
    sa.Column('date_published', sa.DateTime(timezone=True), nullable=False),
    sa.Column('price', sa.Float(), nullable=True),
    sa.Column('img_url', sa.String(length=250), nullable=False),
    sa.Column('ingredients_used', sa.String(length=1000), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('recipeingredients',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('ingredient_id', sa.Integer(), nullable=False),
    sa.Column('recipe_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['ingredient_id'], ['ingredient.id'], ),
    sa.ForeignKeyConstraint(['recipe_id'], ['recipe.id'], ),
    sa.PrimaryKeyConstraint('id', 'ingredient_id', 'recipe_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('recipeingredients')
    op.drop_table('recipe')
    op.drop_table('ingredient')
    op.drop_table('contact')
    # ### end Alembic commands ###
