"""ADD shared to repo

Revision ID: 18b5fce3df50
Revises: 99e32b8689c9
Create Date: 2021-11-16 20:38:23.304207

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "18b5fce3df50"
down_revision = "99e32b8689c9"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("assignment_repo", sa.Column("shared", sa.Boolean(), nullable=True))
    conn = op.get_bind()
    with conn.begin():
        conn.execute("update assignment_repo set `shared` = 0;")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("assignment_repo", "shared")
    # ### end Alembic commands ###
