-
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.
[ASI-794] Skip tx not block when missing refs (#2295)
* Adds model nullable validator util and unit tests * Adds 'level' column to skipped txs table * Adds logic to skip tx without raising error when a record to be inserted is missing required fields * Adds integration tests for user_replica_set.py
- Loading branch information
Showing
19 changed files
with
1,291 additions
and
274 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
discovery-provider/alembic/versions/f775fb87f5ff_add_skipped_transaction_level_column.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,37 @@ | ||
"""add skipped_transaction level column | ||
Revision ID: f775fb87f5ff | ||
Revises: be27a2794f75 | ||
Create Date: 2022-01-12 22:32:24.949547 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "f775fb87f5ff" | ||
down_revision = "be27a2794f75" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
skippedtransactionlevel = sa.Enum("node", "network", name="skippedtransactionlevel") | ||
skippedtransactionlevel.create(op.get_bind()) | ||
op.add_column( | ||
"skipped_transactions", | ||
sa.Column( | ||
"level", | ||
sa.Enum("node", "network", name="skippedtransactionlevel"), | ||
nullable=True, | ||
), | ||
) | ||
op.execute("UPDATE skipped_transactions SET level = 'network'") | ||
op.alter_column("skipped_transactions", "level", nullable=False) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column("skipped_transactions", "level") | ||
bind = op.get_bind() | ||
sa.Enum(name="skippedtransactionlevel").drop(bind, checkfirst=False) |
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.