"""next_shift

Revision ID: 0004
Revises: 0003
Create Date: 2021-08-11 22:54:43.935997+00:00

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('composition', sa.Column('full_service', sa.Boolean(), nullable=True))
    op.alter_column('composition', 'service_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.add_column('shift', sa.Column('next_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'shift', 'shift', ['next_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'shift', type_='foreignkey')
    op.drop_column('shift', 'next_id')
    op.alter_column('composition', 'service_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.drop_column('composition', 'full_service')
    # ### end Alembic commands ###
