-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UserBalanceChange table and add code to handle tier change notifi…
…cations (#1930) * Add UserBalanceChange table and add code to handle tier change notifications * Update user balance change calculation
- Loading branch information
1 parent
8feda2f
commit 3dbb5a1
Showing
13 changed files
with
234 additions
and
26 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
discovery-provider/alembic/versions/591a66d44e5b_create_user_balance_changes_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""create_user_balance_changes_table | ||
Revision ID: 591a66d44e5b | ||
Revises: e2a8aea2e2e1 | ||
Create Date: 2021-10-01 16:24:24.444296 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '591a66d44e5b' | ||
down_revision = 'e2a8aea2e2e1' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"user_balance_changes", | ||
sa.Column("user_id", sa.Integer(), nullable=False, primary_key=True), | ||
sa.Column("blocknumber", sa.Integer(), nullable=False), | ||
sa.Column("current_balance", sa.String(), nullable=False), | ||
sa.Column("previous_balance", sa.String(), nullable=False), | ||
sa.Column("created_at", sa.DateTime(), nullable=False, default=sa.func.now()), | ||
sa.Column("updated_at", sa.DateTime(), nullable=False, default=sa.func.now()), | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_table('user_balance_changes') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.