"""add url and remove not null

Revision ID: 449e7be87951
Revises: dcfaf3599487
Create Date: 2019-03-10 14:52:23.573207

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '449e7be87951'
down_revision = 'dcfaf3599487'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('photo_model', sa.Column('photo_url', sa.String(length=254), nullable=True))
    op.alter_column('photo_model', 'photo_filename',
               existing_type=sa.VARCHAR(length=80),
               nullable=True)
    op.drop_constraint(u'photo_model_photo_filename_key', 'photo_model', type_='unique')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(u'photo_model_photo_filename_key', 'photo_model', ['photo_filename'])
    op.alter_column('photo_model', 'photo_filename',
               existing_type=sa.VARCHAR(length=80),
               nullable=False)
    op.drop_column('photo_model', 'photo_url')
    # ### end Alembic commands ###
