From 0a771ddfbca1254be331149ccf2d162aa09b7bc0 Mon Sep 17 00:00:00 2001 From: kompotkot Date: Thu, 28 Oct 2021 12:43:13 +0000 Subject: [PATCH] Transaction type column --- db/alembic/versions/0b46c8e17bf2_fields_for_eip_1559.py | 2 ++ db/moonstreamdb/models.py | 1 + 2 files changed, 3 insertions(+) diff --git a/db/alembic/versions/0b46c8e17bf2_fields_for_eip_1559.py b/db/alembic/versions/0b46c8e17bf2_fields_for_eip_1559.py index 488170bc..93863217 100644 --- a/db/alembic/versions/0b46c8e17bf2_fields_for_eip_1559.py +++ b/db/alembic/versions/0b46c8e17bf2_fields_for_eip_1559.py @@ -21,11 +21,13 @@ def upgrade(): op.add_column('ethereum_blocks', sa.Column('base_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True)) op.add_column('ethereum_transactions', sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True)) op.add_column('ethereum_transactions', sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True)) + op.add_column('ethereum_transactions', sa.Column('transaction_type', sa.Integer(), nullable=True)) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('ethereum_transactions', 'transaction_type') op.drop_column('ethereum_transactions', 'max_priority_fee_per_gas') op.drop_column('ethereum_transactions', 'max_fee_per_gas') op.drop_column('ethereum_blocks', 'base_fee_per_gas') diff --git a/db/moonstreamdb/models.py b/db/moonstreamdb/models.py index 0dfa3326..f88c8bea 100644 --- a/db/moonstreamdb/models.py +++ b/db/moonstreamdb/models.py @@ -98,6 +98,7 @@ class EthereumTransaction(Base): # type: ignore input = Column(Text) nonce = Column(VARCHAR(256)) transaction_index = Column(BigInteger) + transaction_type = Column(Integer, nullable=True) value = Column(Numeric(precision=78, scale=0), index=True) indexed_at = Column(