Skip to content
Snippets Groups Projects
Unverified Commit 081fdf9c authored by f00wl's avatar f00wl
Browse files

refactor(username): add attribut rename migration file

parent f0c3c5f9
No related branches found
No related tags found
No related merge requests found
Pipeline #35946 failed
""" rename attribut username to name
Revision ID: 130f47ff65a4
Revises: 46ae534e284f
Create Date: 2025-02-27 15:08:43.767378
"""
from alembic import op
import sqlalchemy as sa
import hiboo
revision = "130f47ff65a4"
down_revision = "46ae534e284f"
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("user") as batch_op:
batch_op.alter_column(
"username",
new_column_name="name",
existing_type=sa.String(length=255),
existing_nullable=False,
)
with op.batch_alter_table("profile") as batch_op:
batch_op.alter_column(
"username",
new_column_name="name",
existing_type=sa.String(length=255),
existing_nullable=False,
)
with op.batch_alter_table("claimname") as batch_op:
batch_op.alter_column(
"username",
new_column_name="name",
existing_type=sa.String(length=255),
existing_nullable=False,
)
def downgrade():
with op.batch_alter_table("user") as batch_op:
batch_op.alter_column(
"name",
new_column_name="username",
existing_type=sa.String(length=255),
existing_nullable=False,
)
with op.batch_alter_table("profile") as batch_op:
batch_op.alter_column(
"name",
new_column_name="username",
existing_type=sa.String(length=255),
existing_nullable=False,
)
with op.batch_alter_table("claimname") as batch_op:
batch_op.alter_column(
"name",
new_column_name="username",
existing_type=sa.String(length=255),
existing_nullable=False,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment