add user
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""add login_disabled to user
|
||||
|
||||
Revision ID: 14e183c4b6df
|
||||
Revises: a094273c2998
|
||||
Create Date: 2025-09-12 18:12:56.352634
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '14e183c4b6df'
|
||||
down_revision = 'a094273c2998'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('login_disabled', sa.Boolean(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.drop_column('login_disabled')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,31 @@
|
||||
"""is_admin + root on user
|
||||
|
||||
Revision ID: 5eb0433d235c
|
||||
Revises: 70b40a0d8417
|
||||
Create Date: 2025-09-11 10:46:05.630215
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "5eb0433d235c"
|
||||
down_revision = "70b40a0d8417"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table("user", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("is_admin", sa.Boolean(), nullable=True, default=False)
|
||||
)
|
||||
batch_op.add_column(sa.Column("root", sa.String(), nullable=True))
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("user", schema=None) as batch_op:
|
||||
batch_op.drop_column("root")
|
||||
batch_op.drop_column("is_admin")
|
||||
@@ -0,0 +1,39 @@
|
||||
"""remove email form user
|
||||
|
||||
Revision ID: a094273c2998
|
||||
Revises: 5eb0433d235c
|
||||
Create Date: 2025-09-11 12:02:53.976510
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "a094273c2998"
|
||||
down_revision = "5eb0433d235c"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table("user", schema=None) as batch_op:
|
||||
batch_op.drop_constraint(batch_op.f("uq_user_email"), type_="unique")
|
||||
batch_op.create_unique_constraint(
|
||||
batch_op.f("uq_user_username"), ["username"]
|
||||
)
|
||||
batch_op.drop_column("email")
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("user", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("email", sa.VARCHAR(length=80), nullable=True)
|
||||
)
|
||||
batch_op.drop_constraint(
|
||||
batch_op.f("uq_user_username"), type_="unique"
|
||||
)
|
||||
batch_op.create_unique_constraint(
|
||||
batch_op.f("uq_user_email"), ["email"]
|
||||
)
|
||||
Reference in New Issue
Block a user