"""Initial migration

Revision ID: bcd38fbfb3cc
Revises: 
Create Date: 2021-07-13 16:47:34.408444

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('playlist', sa.Column('title', sa.String(), nullable=False))
    op.drop_constraint('playlist_name_key', 'playlist', type_='unique')
    op.create_unique_constraint(None, 'playlist', ['title'])
    op.drop_column('playlist', 'name')
    op.add_column('track', sa.Column('title', sa.String(), nullable=False))
    op.add_column('track', sa.Column('length', sa.String(), nullable=False))
    op.drop_column('track', 'name')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('track', sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False))
    op.drop_column('track', 'length')
    op.drop_column('track', 'title')
    op.add_column('playlist', sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'playlist', type_='unique')
    op.create_unique_constraint('playlist_name_key', 'playlist', ['name'])
    op.drop_column('playlist', 'title')
    # ### end Alembic commands ###
