"""ADD playground column

Revision ID: f201544d8948
Revises: 7ffbd4403838
Create Date: 2021-12-18 19:43:03.453266

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "f201544d8948"
down_revision = "7ffbd4403838"
branch_labels = None
depends_on = None


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


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