"""add create_at available_time Artist Table

Revision ID: 98d650b1f984
Revises: fb96a477909e
Create Date: 2020-04-26 21:33:46.216367

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '98d650b1f984'
down_revision = 'fb96a477909e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('Artist', sa.Column('available_time', sa.String(), nullable=True))
    op.add_column('Artist', sa.Column('created_at', sa.DateTime(), nullable=True))
    op.drop_constraint(u'Artist_city_state_id_fkey', 'Artist', type_='foreignkey')
    op.create_foreign_key(None, 'Artist', 'CityState', ['city_state_id'], ['id'], ondelete='CASCADE')
    op.drop_constraint(u'Show_venue_id_fkey', 'Show', type_='foreignkey')
    op.drop_constraint(u'Show_artist_id_fkey', 'Show', type_='foreignkey')
    op.create_foreign_key(None, 'Show', 'Artist', ['artist_id'], ['id'], ondelete='CASCADE')
    op.create_foreign_key(None, 'Show', 'Venue', ['venue_id'], ['id'], ondelete='CASCADE')
    op.add_column('Venue', sa.Column('created_at', sa.DateTime(), nullable=True))
    op.drop_constraint(u'Venue_city_state_id_fkey', 'Venue', type_='foreignkey')
    op.create_foreign_key(None, 'Venue', 'CityState', ['city_state_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'Venue', type_='foreignkey')
    op.create_foreign_key(u'Venue_city_state_id_fkey', 'Venue', 'CityState', ['city_state_id'], ['id'])
    op.drop_column('Venue', 'created_at')
    op.drop_constraint(None, 'Show', type_='foreignkey')
    op.drop_constraint(None, 'Show', type_='foreignkey')
    op.create_foreign_key(u'Show_artist_id_fkey', 'Show', 'Artist', ['artist_id'], ['id'])
    op.create_foreign_key(u'Show_venue_id_fkey', 'Show', 'Venue', ['venue_id'], ['id'])
    op.drop_constraint(None, 'Artist', type_='foreignkey')
    op.create_foreign_key(u'Artist_city_state_id_fkey', 'Artist', 'CityState', ['city_state_id'], ['id'])
    op.drop_column('Artist', 'created_at')
    op.drop_column('Artist', 'available_time')
    # ### end Alembic commands ###
