"""ADD anubis developer to user

Revision ID: 5396e908cf7b
Revises: 5ea160112b7e
Create Date: 2022-09-19 21:55:28.169282

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "5396e908cf7b"
down_revision = "5ea160112b7e"
branch_labels = None
depends_on = None


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


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