Skip to content

Commit a7253c2

Browse files
committed
Add daily streak column
1 parent 2f07c1c commit a7253c2

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""Add daily streak column
2+
3+
Revision ID: c0fcd66c3df6
4+
Revises: 5e8982aea1ef
5+
Create Date: 2025-01-04 18:51:36.383519
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = 'c0fcd66c3df6'
14+
down_revision = '5e8982aea1ef'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### 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_completion_date', sa.Date(), nullable=False))
23+
batch_op.add_column(sa.Column('daily_streak', sa.Integer(), nullable=False))
24+
25+
# ### end Alembic commands ###
26+
27+
28+
def downgrade():
29+
# ### commands auto generated by Alembic - please adjust! ###
30+
with op.batch_alter_table('user', schema=None) as batch_op:
31+
batch_op.drop_column('daily_streak')
32+
batch_op.drop_column('last_completion_date')
33+
34+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)