gitscope
← marzneshin / v0.6.1 / app/db/migrations/versions/e8325f600a49_user_enable.py
https://dev.kronoz.win/r/marzneshin.git
app/db/migrations/versions/e8325f600a49_user_enable.py · Python
Blame Raw
 1"""Add enabled to users
 2
 3Revision ID: e8325f600a49
 4Revises: 20faa9f18c0a
 5Create Date: 2024-05-01 13:39:53.944195
 6
 7"""
 8
 9from alembic import op
10import sqlalchemy as sa
11
12
13# revision identifiers, used by Alembic.
14revision = "e8325f600a49"
15down_revision = "20faa9f18c0a"
16branch_labels = None
17depends_on = None
18
19
20def upgrade() -> None:
21    # ### commands auto generated by Alembic - please adjust! ###
22    op.add_column(
23        "users",
24        sa.Column(
25            "enabled",
26            sa.Boolean(),
27            server_default=sa.sql.true(),
28            nullable=False,
29        ),
30    )
31    # ### end Alembic commands ###
32
33
34def downgrade() -> None:
35    # ### commands auto generated by Alembic - please adjust! ###
36    op.drop_column("users", "enabled")
37    # ### end Alembic commands ###