Skip to content

Commit 94e7636

Browse files
committed
Format migration code
1 parent b0a51cf commit 94e7636

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

migrations/versions/5d319985c5f2_create_user_table.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,36 @@
55
Create Date: 2025-01-04 19:10:25.736507
66
77
"""
8+
89
from alembic import op
910
import sqlalchemy as sa
1011

1112

1213
# revision identifiers, used by Alembic.
13-
revision = '5d319985c5f2'
14+
revision = "5d319985c5f2"
1415
down_revision = None
1516
branch_labels = None
1617
depends_on = None
1718

1819

1920
def upgrade():
2021
# ### commands auto generated by Alembic - please adjust! ###
21-
op.create_table('user',
22-
sa.Column('id', sa.Integer(), nullable=False),
23-
sa.Column('username', sa.String(length=80), nullable=False),
24-
sa.Column('xp', sa.Float(), nullable=False),
25-
sa.Column('xp_required', sa.Float(), nullable=False),
26-
sa.Column('total_xp', sa.Float(), nullable=False),
27-
sa.Column('level', sa.Integer(), nullable=False),
28-
sa.PrimaryKeyConstraint('id'),
29-
sa.UniqueConstraint('id'),
30-
sa.UniqueConstraint('username')
22+
op.create_table(
23+
"user",
24+
sa.Column("id", sa.Integer(), nullable=False),
25+
sa.Column("username", sa.String(length=80), nullable=False),
26+
sa.Column("xp", sa.Float(), nullable=False),
27+
sa.Column("xp_required", sa.Float(), nullable=False),
28+
sa.Column("total_xp", sa.Float(), nullable=False),
29+
sa.Column("level", sa.Integer(), nullable=False),
30+
sa.PrimaryKeyConstraint("id"),
31+
sa.UniqueConstraint("id"),
32+
sa.UniqueConstraint("username"),
3133
)
3234
# ### end Alembic commands ###
3335

3436

3537
def downgrade():
3638
# ### commands auto generated by Alembic - please adjust! ###
37-
op.drop_table('user')
39+
op.drop_table("user")
3840
# ### end Alembic commands ###

0 commit comments

Comments
 (0)