Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
""" 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,
)