"""Bind Chores to user

Revision ID: a6fe0494c1f0
Revises: 944acee085dd
Create Date: 2020-07-29 15:37:16.561484

"""
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "a6fe0494c1f0"
down_revision = "944acee085dd"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###

    with op.batch_alter_table("chore", schema=None) as batch_op:
        batch_op.add_column(sa.Column("user_id", sa.Integer(), nullable=True))
        batch_op.create_foreign_key("chore_user_id_fkey", "user", ["user_id"], ["id"])
        # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("chore_user_id_fkey", "chore", type_="foreignkey")
    op.drop_column("chore", "user_id")
    # ### end Alembic commands ###
