"""Add templates

Revision ID: b4f524e2140c
Revises: ed3100326c38
Create Date: 2022-10-01 13:30:21.663287

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_foreign_key(None, 'playlist_rows', 'tracks', ['track_id'], ['id'])
    op.create_foreign_key(None, 'playlist_rows', 'playlists', ['playlist_id'], ['id'])
    op.add_column('playlists', sa.Column('is_template', sa.Boolean(), nullable=False))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('playlists', 'is_template')
    op.drop_constraint(None, 'playlist_rows', type_='foreignkey')
    op.drop_constraint(None, 'playlist_rows', type_='foreignkey')
    # ### end Alembic commands ###
