MonScoDocEssai/migrations/versions/4c19fcb42636_cas.py

48 lines
1.2 KiB
Python

"""CAS
Revision ID: 4c19fcb42636
Revises: d8288b7f0a3e
Create Date: 2023-02-26 20:58:30.113631
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "4c19fcb42636"
down_revision = "d8288b7f0a3e"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("user", sa.Column("cas_id", sa.Text(), nullable=True))
op.add_column(
"user",
sa.Column(
"cas_allow_login", sa.Boolean(), server_default="false", nullable=False
),
)
op.add_column(
"user",
sa.Column(
"cas_allow_scodoc_login",
sa.Boolean(),
server_default="false",
nullable=False,
),
)
op.create_index(op.f("ix_user_cas_id"), "user", ["cas_id"], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_user_cas_id"), table_name="user")
op.drop_column("user", "cas_allow_scodoc_login")
op.drop_column("user", "cas_allow_login")
op.drop_column("user", "cas_id")
# ### end Alembic commands ###