This commit is contained in:
rob
2025-09-12 22:03:24 +01:00
parent c1011af06a
commit 1ccba36a4e
42 changed files with 1041 additions and 182 deletions
@@ -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"]
)