"""add images to recipe and user

Revision ID: 05c0fe7b2fd4
Revises: e1c3d1a81438
Create Date: 2019-10-13 11:59:17.326797

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '05c0fe7b2fd4'
down_revision = 'e1c3d1a81438'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('recipe', schema=None) as batch_op:
        batch_op.add_column(sa.Column('featured_image', sa.String(length=255), nullable=True))
        batch_op.add_column(sa.Column('images', sa.ARRAY(sa.String(length=255), dimensions=1), nullable=True))

    with op.batch_alter_table('user', schema=None) as batch_op:
        batch_op.add_column(sa.Column('profile_image', sa.String(length=255), nullable=True))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user', schema=None) as batch_op:
        batch_op.drop_column('profile_image')

    with op.batch_alter_table('recipe', schema=None) as batch_op:
        batch_op.drop_column('images')
        batch_op.drop_column('featured_image')

    # ### end Alembic commands ###
