"""Add jellyfin_id to Playlists, remove jellyfin_id from user_playlists, the second again 

Revision ID: 5a06403b57cf
Revises: 6089eb604dbf
Create Date: 2024-10-23 08:32:11.962812

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5a06403b57cf'
down_revision = '6089eb604dbf'
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('jellyfin_id', sa.String(length=120), nullable=True))

    with op.batch_alter_table('user_playlists', schema=None) as batch_op:
        batch_op.drop_column('jellyfin_id')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user_playlists', schema=None) as batch_op:
        batch_op.add_column(sa.Column('jellyfin_id', sa.VARCHAR(length=120), autoincrement=False, nullable=True))

    with op.batch_alter_table('playlist', schema=None) as batch_op:
        batch_op.drop_column('jellyfin_id')

    # ### end Alembic commands ###
