Skip to content

Commit 89d758d

Browse files
committed
Format migration code
1 parent 07edad5 commit 89d758d

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

migrations/versions/90e9dc716399_add_time_multiplier.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,42 @@
55
Create Date: 2025-01-20 18:06:55.299473
66
77
"""
8+
89
from alembic import op
910
import sqlalchemy as sa
1011

1112

1213
# revision identifiers, used by Alembic.
13-
revision = '90e9dc716399'
14-
down_revision = 'a5e285045629'
14+
revision = "90e9dc716399"
15+
down_revision = "a5e285045629"
1516
branch_labels = None
1617
depends_on = None
1718

1819

1920
def upgrade():
2021
# ### commands auto generated by Alembic - please adjust! ###
21-
with op.batch_alter_table('user', schema=None) as batch_op:
22-
batch_op.add_column(sa.Column('last_time_clicked', sa.DateTime(), server_default='CURRENT_TIMESTAMP', nullable=False))
23-
batch_op.add_column(sa.Column('time_multiplier', sa.Integer(), server_default='1', nullable=False))
22+
with op.batch_alter_table("user", schema=None) as batch_op:
23+
batch_op.add_column(
24+
sa.Column(
25+
"last_time_clicked",
26+
sa.DateTime(),
27+
server_default="CURRENT_TIMESTAMP",
28+
nullable=False,
29+
)
30+
)
31+
batch_op.add_column(
32+
sa.Column(
33+
"time_multiplier", sa.Integer(), server_default="1", nullable=False
34+
)
35+
)
2436

2537
# ### end Alembic commands ###
2638

2739

2840
def downgrade():
2941
# ### commands auto generated by Alembic - please adjust! ###
30-
with op.batch_alter_table('user', schema=None) as batch_op:
31-
batch_op.drop_column('time_multiplier')
32-
batch_op.drop_column('last_time_clicked')
42+
with op.batch_alter_table("user", schema=None) as batch_op:
43+
batch_op.drop_column("time_multiplier")
44+
batch_op.drop_column("last_time_clicked")
3345

3446
# ### end Alembic commands ###

0 commit comments

Comments
 (0)