40 lines
1012 B
Python
40 lines
1012 B
Python
"""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"]
|
|
)
|