forked from ScoDoc/ScoDoc
Migration base pour CAS
This commit is contained in:
parent
cba81a7742
commit
0c38e5e62a
47
migrations/versions/4c19fcb42636_cas.py
Normal file
47
migrations/versions/4c19fcb42636_cas.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
"""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 ###
|
Loading…
Reference in New Issue
Block a user