"""ADD theia session docker column

Revision ID: 2faa37dff9d0
Revises: d5de41411043
Create Date: 2022-09-19 20:59:20.531115

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "2faa37dff9d0"
down_revision = "d5de41411043"
branch_labels = None
depends_on = None


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


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