"""ADD course display visuals option

Revision ID: c87807debbda
Revises: 86296424818b
Create Date: 2021-09-19 11:42:56.766233

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "c87807debbda"
down_revision = "86296424818b"
branch_labels = None
depends_on = None


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


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