"""empty message

Revision ID: 0421471e1f95
Revises: d233f8d16e49
Create Date: 2019-11-09 21:23:16.912103

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '0421471e1f95'
down_revision = 'd233f8d16e49'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('image',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('url', sa.String(), nullable=False),
    sa.Column('username', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['username'], ['user.username'], name=op.f('fk_image_username_user')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_image'))
    )
    with op.batch_alter_table('recipe', schema=None) as batch_op:
        batch_op.drop_column('images')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('recipe', schema=None) as batch_op:
        batch_op.add_column(sa.Column('images', postgresql.ARRAY(sa.VARCHAR(length=255)), autoincrement=False, nullable=True))

    op.drop_table('image')
    # ### end Alembic commands ###
