"""Added spotify_uri

Revision ID: 8843534fa7ea
Revises: 05f2ef26e1a8
Create Date: 2024-10-10 13:27:34.675770

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8843534fa7ea'
down_revision = '05f2ef26e1a8'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('playlist', schema=None) as batch_op:
        batch_op.add_column(sa.Column('spotify_uri', sa.String(length=120), nullable=False))
        batch_op.create_unique_constraint(None, ['spotify_uri'])

    with op.batch_alter_table('track', schema=None) as batch_op:
        batch_op.add_column(sa.Column('spotify_uri', sa.String(length=120), nullable=False))
        batch_op.create_unique_constraint(None, ['spotify_uri'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('track', schema=None) as batch_op:
        batch_op.drop_constraint(None, type_='unique')
        batch_op.drop_column('spotify_uri')

    with op.batch_alter_table('playlist', schema=None) as batch_op:
        batch_op.drop_constraint(None, type_='unique')
        batch_op.drop_column('spotify_uri')

    # ### end Alembic commands ###
