"""generating_shifts

Revision ID: 0003
Revises: 0002
Create Date: 2021-07-15 14:26:32.910804+00:00

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('schedule', sa.Column('threshold_day', sa.Interval(), nullable=False))
    op.add_column('shift', sa.Column('schedule_id', sa.Integer(), nullable=False))
    op.create_foreign_key(None, 'shift', 'schedule', ['schedule_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'shift', type_='foreignkey')
    op.drop_column('shift', 'schedule_id')
    op.drop_column('schedule', 'threshold_day')
    # ### end Alembic commands ###
