Skip to content

Commit

Permalink
Update c045e432555c_add_referal_model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkiyyat authored Jan 27, 2025
1 parent d2aeebf commit cedaf09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web_app/alembic/versions/c045e432555c_add_referal_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@


def upgrade() -> None:
"""
Creates the referal table with UUID id, user_id foreign key,
referal_id string(16), and created_at datetime fields.
Also creates indexes on user_id and referal_id.
"""
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('referal',
sa.Column('id', sa.UUID(), nullable=False),
Expand All @@ -32,6 +37,9 @@ def upgrade() -> None:


def downgrade() -> None:
"""
Removes the referal table and its associated indexes.
"""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_referal_user_id'), table_name='referal')
op.drop_index(op.f('ix_referal_referal_id'), table_name='referal')
Expand Down

0 comments on commit cedaf09

Please sign in to comment.