From a5a3c6e60224e47b473b44af4476048d832472a4 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 10 Nov 2024 23:26:19 +0200 Subject: [PATCH 1/6] Add transaction tables --- moonstreamdb-v3/moonstreamdbv3/alembic/env.py | 56 ++++++ moonstreamdb-v3/moonstreamdbv3/models.py | 162 ++++++++++++++++++ moonstreamdb-v3/moonstreamdbv3/version.txt | 2 +- 3 files changed, 219 insertions(+), 1 deletion(-) diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/env.py b/moonstreamdb-v3/moonstreamdbv3/alembic/env.py index 082d718ea..6bf1ec414 100644 --- a/moonstreamdb-v3/moonstreamdbv3/alembic/env.py +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/env.py @@ -27,70 +27,126 @@ from moonstreamdbv3.models import ( MOONSTREAM_DB_V3_SCHEMA_NAME, AmoyLabel, + AmoyTransaction, ArbitrumNovaLabel, + ArbitrumNovaTransaction, ArbitrumOneLabel, + ArbitrumOneTransaction, ArbitrumSepoliaLabel, + ArbitrumSepoliaTransaction, AvalancheFujiLabel, + AvalancheFujiTransaction, AvalancheLabel, + AvalancheTransaction, B3Label, + B3Transaction, B3SepoliaLabel, + B3SepoliaTransaction, BaseLabel, + BaseTransaction, BlastLabel, + BlastTransaction, BlastSepoliaLabel, + BlastSepoliaTransaction, EthereumLabel, + EthereumTransaction, Game7Label, + Game7Transaction, Game7OrbitArbitrumSepoliaLabel, + Game7OrbitArbitrumSepoliaTransaction, Game7TestnetLabel, + Game7TestnetTransaction, ImxZkevmLabel, + ImxZkevmTransaction, ImxZkevmSepoliaLabel, + ImxZkevmSepoliaTransaction, MantleLabel, + MantleTransaction, MantleSepoliaLabel, + MantleSepoliaTransaction, MumbaiLabel, + MumbaiTransaction, PolygonLabel, + PolygonTransaction, ProofOfPlayApexLabel, + ProofOfPlayApexTransaction, SepoliaLabel, + SepoliaTransaction, StarknetLabel, StarknetSepoliaLabel, XaiLabel, + XaiTransaction, XaiSepoliaLabel, + XaiSepoliaTransaction, XDaiLabel, + XDaiTransaction, ZkSyncEraLabel, + ZkSyncEraTransaction, ZkSyncEraSepoliaLabel, + ZkSyncEraSepoliaTransaction, ) def include_symbol(tablename, schema): return tablename in { EthereumLabel.__tablename__, + EthereumTransaction.__tablename__, SepoliaLabel.__tablename__, + SepoliaTransaction.__tablename__, PolygonLabel.__tablename__, + PolygonTransaction.__tablename__, MumbaiLabel.__tablename__, + MumbaiTransaction.__tablename__, AmoyLabel.__tablename__, + AmoyTransaction.__tablename__, XDaiLabel.__tablename__, + XDaiTransaction.__tablename__, ZkSyncEraLabel.__tablename__, + ZkSyncEraTransaction.__tablename__, ZkSyncEraSepoliaLabel.__tablename__, + ZkSyncEraSepoliaTransaction.__tablename__, BaseLabel.__tablename__, + BaseTransaction.__tablename__, ArbitrumNovaLabel.__tablename__, + ArbitrumNovaTransaction.__tablename__, ArbitrumOneLabel.__tablename__, + ArbitrumOneTransaction.__tablename__, ArbitrumSepoliaLabel.__tablename__, + ArbitrumSepoliaTransaction.__tablename__, Game7Label.__tablename__, + Game7Transaction.__tablename__, Game7OrbitArbitrumSepoliaLabel.__tablename__, + Game7OrbitArbitrumSepoliaTransaction.__tablename__, Game7TestnetLabel.__tablename__, + Game7TestnetTransaction.__tablename__, XaiLabel.__tablename__, + XaiTransaction.__tablename__, XaiSepoliaLabel.__tablename__, + XaiSepoliaTransaction.__tablename__, AvalancheLabel.__tablename__, + AvalancheTransaction.__tablename__, AvalancheFujiLabel.__tablename__, + AvalancheFujiTransaction.__tablename__, BlastLabel.__tablename__, + BlastTransaction.__tablename__, BlastSepoliaLabel.__tablename__, + BlastSepoliaTransaction.__tablename__, ProofOfPlayApexLabel.__tablename__, + ProofOfPlayApexTransaction.__tablename__, StarknetLabel.__tablename__, StarknetSepoliaLabel.__tablename__, MantleLabel.__tablename__, + MantleTransaction.__tablename__, MantleSepoliaLabel.__tablename__, + MantleSepoliaTransaction.__tablename__, ImxZkevmLabel.__tablename__, + ImxZkevmTransaction.__tablename__, ImxZkevmSepoliaLabel.__tablename__, + ImxZkevmSepoliaTransaction.__tablename__, B3Label.__tablename__, + B3Transaction.__tablename__, B3SepoliaLabel.__tablename__, + B3SepoliaTransaction.__tablename__, } diff --git a/moonstreamdb-v3/moonstreamdbv3/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index 1547680b1..353cda776 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -124,6 +124,38 @@ class EvmBasedLabel(Base): # type: ignore ) +class EvmBasedTransaction(Base): # type: ignore + __abstract__ = True + + hash = Column( + VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True + ) + block_number = ( + Column( + BigInteger, + nullable=False, + index=True, + ), + ) + block_timestamp = Column(BigInteger, nullable=False, index=True) + block_hash = Column(VARCHAR(256), nullable=False, index=True) + from_address = Column(LargeBinary, index=True) + to_address = Column(LargeBinary, index=True) + gas = Column(BigInteger, index=True) + gas_price = Column(BigInteger, index=True) + max_fee_per_gas = Column(BigInteger, nullable=True) + max_priority_fee_per_gas = Column(BigInteger, nullable=True) + input = Column(Text) + nonce = Column(BigInteger) + transaction_index = Column(BigInteger) + transaction_type = Column(Integer, nullable=True) + value = Column(BigInteger, index=True) + + indexed_at = Column( + DateTime(timezone=True), server_default=utcnow(), nullable=False + ) + + class EthereumLabel(EvmBasedLabel): # type: ignore __tablename__ = "ethereum_labels" @@ -169,6 +201,10 @@ class EthereumLabel(EvmBasedLabel): # type: ignore ) +class EthereumTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "ethereum_transactions" + + class SepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "sepolia_labels" @@ -214,6 +250,10 @@ class SepoliaLabel(EvmBasedLabel): # type: ignore ) +class SepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "sepolia_transactions" + + class PolygonLabel(EvmBasedLabel): # type: ignore __tablename__ = "polygon_labels" @@ -259,6 +299,10 @@ class PolygonLabel(EvmBasedLabel): # type: ignore ) +class PolygonTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "polygon_transactions" + + class MumbaiLabel(EvmBasedLabel): # type: ignore __tablename__ = "mumbai_labels" @@ -304,6 +348,10 @@ class MumbaiLabel(EvmBasedLabel): # type: ignore ) +class MumbaiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "mumbai_transactions" + + class AmoyLabel(EvmBasedLabel): # type: ignore __tablename__ = "amoy_labels" @@ -349,6 +397,10 @@ class AmoyLabel(EvmBasedLabel): # type: ignore ) +class AmoyTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "amoy_transactions" + + class XDaiLabel(EvmBasedLabel): # type: ignore __tablename__ = "xdai_labels" @@ -394,6 +446,10 @@ class XDaiLabel(EvmBasedLabel): # type: ignore ) +class XDaiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "xdai_transactions" + + class ZkSyncEraLabel(EvmBasedLabel): # type: ignore __tablename__ = "zksync_era_labels" @@ -439,6 +495,10 @@ class ZkSyncEraLabel(EvmBasedLabel): # type: ignore ) +class ZkSyncEraTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "zksync_era_transactions" + + class ZkSyncEraSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "zksync_era_sepolia_labels" @@ -484,6 +544,10 @@ class ZkSyncEraSepoliaLabel(EvmBasedLabel): # type: ignore ) +class ZkSyncEraSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "zksync_era_sepolia_transactions" + + class BaseLabel(EvmBasedLabel): # type: ignore __tablename__ = "base_labels" @@ -529,6 +593,10 @@ class BaseLabel(EvmBasedLabel): # type: ignore ) +class BaseTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "base_transactions" + + class ArbitrumNovaLabel(EvmBasedLabel): # type: ignore __tablename__ = "arbitrum_nova_labels" @@ -574,6 +642,12 @@ class ArbitrumNovaLabel(EvmBasedLabel): # type: ignore ) +class ArbitrumNovaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "arbitrum_nova_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class ArbitrumOneLabel(EvmBasedLabel): # type: ignore __tablename__ = "arbitrum_one_labels" @@ -619,6 +693,12 @@ class ArbitrumOneLabel(EvmBasedLabel): # type: ignore ) +class ArbitrumOneTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "arbitrum_one_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class ArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "arbitrum_sepolia_labels" @@ -664,6 +744,12 @@ class ArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore ) +class ArbitrumOneSepoliaLabel(EvmBasedLabel): # type: ignore + __tablename__ = "arbitrum_one_sepolia_labels" + + l1_block_number = Column(BigInteger, nullable=True) + + class Game7OrbitArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "game7_orbit_arbitrum_sepolia_labels" @@ -709,6 +795,12 @@ class Game7OrbitArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore ) +class Game7OrbitArbitrumSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "game7_orbit_arbitrum_sepolia_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class XaiLabel(EvmBasedLabel): # type: ignore __tablename__ = "xai_labels" @@ -754,6 +846,12 @@ class XaiLabel(EvmBasedLabel): # type: ignore ) +class XaiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "xai_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class XaiSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "xai_sepolia_labels" @@ -799,6 +897,12 @@ class XaiSepoliaLabel(EvmBasedLabel): # type: ignore ) +class XaiSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "xai_sepolia_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class AvalancheLabel(EvmBasedLabel): # type: ignore __tablename__ = "avalanche_labels" @@ -844,6 +948,10 @@ class AvalancheLabel(EvmBasedLabel): # type: ignore ) +class AvalancheTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "avalanche_transactions" + + class AvalancheFujiLabel(EvmBasedLabel): # type: ignore __tablename__ = "avalanche_fuji_labels" @@ -889,6 +997,10 @@ class AvalancheFujiLabel(EvmBasedLabel): # type: ignore ) +class AvalancheFujiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "avalanche_fuji_transactions" + + class BlastLabel(EvmBasedLabel): # type: ignore __tablename__ = "blast_labels" @@ -934,6 +1046,10 @@ class BlastLabel(EvmBasedLabel): # type: ignore ) +class BlastTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "blast_transactions" + + class BlastSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "blast_sepolia_labels" @@ -979,6 +1095,10 @@ class BlastSepoliaLabel(EvmBasedLabel): # type: ignore ) +class BlastSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "blast_sepolia_transactions" + + class ProofOfPlayApexLabel(EvmBasedLabel): # type: ignore __tablename__ = "proofofplay_apex_labels" @@ -1024,6 +1144,12 @@ class ProofOfPlayApexLabel(EvmBasedLabel): # type: ignore ) +class ProofOfPlayApexTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "proofofplay_apex_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class StarknetLabel(EvmBasedLabel): # type: ignore __tablename__ = "starknet_labels" @@ -1159,6 +1285,10 @@ class MantleLabel(EvmBasedLabel): # type: ignore ) +class MantleTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "mantle_transactions" + + class MantleSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "mantle_sepolia_labels" @@ -1204,6 +1334,10 @@ class MantleSepoliaLabel(EvmBasedLabel): # type: ignore ) +class MantleSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "mantle_sepolia_transactions" + + class ImxZkevmLabel(EvmBasedLabel): # type: ignore __tablename__ = "imx_zkevm_labels" @@ -1249,6 +1383,10 @@ class ImxZkevmLabel(EvmBasedLabel): # type: ignore ) +class ImxZkevmTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "imx_zkevm_transactions" + + class ImxZkevmSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "imx_zkevm_sepolia_labels" @@ -1294,6 +1432,10 @@ class ImxZkevmSepoliaLabel(EvmBasedLabel): # type: ignore ) +class ImxZkevmSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "imx_zkevm_sepolia_transactions" + + class Game7Label(EvmBasedLabel): # type: ignore __tablename__ = "game7_labels" @@ -1339,6 +1481,12 @@ class Game7Label(EvmBasedLabel): # type: ignore ) +class Game7Transaction(EvmBasedTransaction): # type: ignore + __tablename__ = "game7_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class Game7TestnetLabel(EvmBasedLabel): # type: ignore __tablename__ = "game7_testnet_labels" @@ -1384,6 +1532,12 @@ class Game7TestnetLabel(EvmBasedLabel): # type: ignore ) +class Game7TestnetTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "game7_testnet_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + class B3Label(EvmBasedLabel): # type: ignore __tablename__ = "b3_labels" @@ -1429,6 +1583,10 @@ class B3Label(EvmBasedLabel): # type: ignore ) +class B3Transaction(EvmBasedTransaction): # type: ignore + __tablename__ = "b3_transactions" + + class B3SepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "b3_sepolia_labels" @@ -1472,3 +1630,7 @@ class B3SepoliaLabel(EvmBasedLabel): # type: ignore postgresql_where=text("label='seer-raw' and label_type='event'"), ), ) + + +class B3SepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "b3_sepolia_transactions" diff --git a/moonstreamdb-v3/moonstreamdbv3/version.txt b/moonstreamdb-v3/moonstreamdbv3/version.txt index 236c7ad08..818944f5b 100644 --- a/moonstreamdb-v3/moonstreamdbv3/version.txt +++ b/moonstreamdb-v3/moonstreamdbv3/version.txt @@ -1 +1 @@ -0.0.21 +0.0.22 From fc1abfd150e6eaa4ecdb2f8d897d4d4dd2d45aca Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 10 Nov 2024 23:40:54 +0200 Subject: [PATCH 2/6] Add migration. --- .../versions/d13b6bb1d214_add_transactions.py | 2744 +++++++++++++++++ 1 file changed, 2744 insertions(+) create mode 100644 moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py new file mode 100644 index 000000000..27e47df22 --- /dev/null +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py @@ -0,0 +1,2744 @@ +"""add transactions + +Revision ID: d13b6bb1d214 +Revises: d816689b786a +Create Date: 2024-11-10 23:34:21.581396 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision: str = "d13b6bb1d214" +down_revision: Union[str, None] = "d816689b786a" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "amoy_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_amoy_transactions")), + ) + op.create_index( + op.f("ix_amoy_transactions_block_hash"), + "amoy_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_amoy_transactions_block_timestamp"), + "amoy_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_amoy_transactions_from_address"), + "amoy_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_amoy_transactions_gas"), "amoy_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_amoy_transactions_gas_price"), + "amoy_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_amoy_transactions_hash"), "amoy_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_amoy_transactions_to_address"), + "amoy_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_amoy_transactions_value"), "amoy_transactions", ["value"], unique=False + ) + op.create_table( + "arbitrum_nova_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_nova_transactions")), + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_block_hash"), + "arbitrum_nova_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_block_timestamp"), + "arbitrum_nova_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_from_address"), + "arbitrum_nova_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_gas"), + "arbitrum_nova_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_gas_price"), + "arbitrum_nova_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_hash"), + "arbitrum_nova_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_to_address"), + "arbitrum_nova_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_nova_transactions_value"), + "arbitrum_nova_transactions", + ["value"], + unique=False, + ) + op.create_table( + "arbitrum_one_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_one_transactions")), + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_block_hash"), + "arbitrum_one_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_block_timestamp"), + "arbitrum_one_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_from_address"), + "arbitrum_one_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_gas"), + "arbitrum_one_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_gas_price"), + "arbitrum_one_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_hash"), + "arbitrum_one_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_to_address"), + "arbitrum_one_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_one_transactions_value"), + "arbitrum_one_transactions", + ["value"], + unique=False, + ) + op.create_table( + "arbitrum_sepolia_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_sepolia_transactions")), + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_block_hash"), + "arbitrum_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_block_timestamp"), + "arbitrum_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_from_address"), + "arbitrum_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_gas"), + "arbitrum_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_gas_price"), + "arbitrum_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_hash"), + "arbitrum_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_to_address"), + "arbitrum_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_arbitrum_sepolia_transactions_value"), + "arbitrum_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "avalanche_fuji_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_avalanche_fuji_transactions")), + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_block_hash"), + "avalanche_fuji_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_block_timestamp"), + "avalanche_fuji_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_from_address"), + "avalanche_fuji_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_gas"), + "avalanche_fuji_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_gas_price"), + "avalanche_fuji_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_hash"), + "avalanche_fuji_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_to_address"), + "avalanche_fuji_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_fuji_transactions_value"), + "avalanche_fuji_transactions", + ["value"], + unique=False, + ) + op.create_table( + "avalanche_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_avalanche_transactions")), + ) + op.create_index( + op.f("ix_avalanche_transactions_block_hash"), + "avalanche_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_transactions_block_timestamp"), + "avalanche_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_transactions_from_address"), + "avalanche_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_transactions_gas"), + "avalanche_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_transactions_gas_price"), + "avalanche_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_transactions_hash"), + "avalanche_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_avalanche_transactions_to_address"), + "avalanche_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_avalanche_transactions_value"), + "avalanche_transactions", + ["value"], + unique=False, + ) + op.create_table( + "b3_sepolia_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_b3_sepolia_transactions")), + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_block_hash"), + "b3_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_block_timestamp"), + "b3_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_from_address"), + "b3_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_gas"), + "b3_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_gas_price"), + "b3_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_hash"), + "b3_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_to_address"), + "b3_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_b3_sepolia_transactions_value"), + "b3_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "b3_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_b3_transactions")), + ) + op.create_index( + op.f("ix_b3_transactions_block_hash"), + "b3_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_b3_transactions_block_timestamp"), + "b3_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_b3_transactions_from_address"), + "b3_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_b3_transactions_gas"), "b3_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_b3_transactions_gas_price"), + "b3_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_b3_transactions_hash"), "b3_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_b3_transactions_to_address"), + "b3_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_b3_transactions_value"), "b3_transactions", ["value"], unique=False + ) + op.create_table( + "base_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_base_transactions")), + ) + op.create_index( + op.f("ix_base_transactions_block_hash"), + "base_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_base_transactions_block_timestamp"), + "base_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_base_transactions_from_address"), + "base_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_base_transactions_gas"), "base_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_base_transactions_gas_price"), + "base_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_base_transactions_hash"), "base_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_base_transactions_to_address"), + "base_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_base_transactions_value"), "base_transactions", ["value"], unique=False + ) + op.create_table( + "blast_sepolia_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_blast_sepolia_transactions")), + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_block_hash"), + "blast_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_block_timestamp"), + "blast_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_from_address"), + "blast_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_gas"), + "blast_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_gas_price"), + "blast_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_hash"), + "blast_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_to_address"), + "blast_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_blast_sepolia_transactions_value"), + "blast_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "blast_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_blast_transactions")), + ) + op.create_index( + op.f("ix_blast_transactions_block_hash"), + "blast_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_blast_transactions_block_timestamp"), + "blast_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_blast_transactions_from_address"), + "blast_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_blast_transactions_gas"), "blast_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_blast_transactions_gas_price"), + "blast_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_blast_transactions_hash"), "blast_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_blast_transactions_to_address"), + "blast_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_blast_transactions_value"), + "blast_transactions", + ["value"], + unique=False, + ) + op.create_table( + "ethereum_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_ethereum_transactions")), + ) + op.create_index( + op.f("ix_ethereum_transactions_block_hash"), + "ethereum_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_ethereum_transactions_block_timestamp"), + "ethereum_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_ethereum_transactions_from_address"), + "ethereum_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_ethereum_transactions_gas"), + "ethereum_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_ethereum_transactions_gas_price"), + "ethereum_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_ethereum_transactions_hash"), + "ethereum_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_ethereum_transactions_to_address"), + "ethereum_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_ethereum_transactions_value"), + "ethereum_transactions", + ["value"], + unique=False, + ) + op.create_table( + "game7_orbit_arbitrum_sepolia_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint( + "hash", name=op.f("pk_game7_orbit_arbitrum_sepolia_transactions") + ), + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_hash"), + "game7_orbit_arbitrum_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_timestamp"), + "game7_orbit_arbitrum_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_from_address"), + "game7_orbit_arbitrum_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas"), + "game7_orbit_arbitrum_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas_price"), + "game7_orbit_arbitrum_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_hash"), + "game7_orbit_arbitrum_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_to_address"), + "game7_orbit_arbitrum_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_value"), + "game7_orbit_arbitrum_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "game7_testnet_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_game7_testnet_transactions")), + ) + op.create_index( + op.f("ix_game7_testnet_transactions_block_hash"), + "game7_testnet_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_block_timestamp"), + "game7_testnet_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_from_address"), + "game7_testnet_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_gas"), + "game7_testnet_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_gas_price"), + "game7_testnet_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_hash"), + "game7_testnet_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_to_address"), + "game7_testnet_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_game7_testnet_transactions_value"), + "game7_testnet_transactions", + ["value"], + unique=False, + ) + op.create_table( + "game7_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_game7_transactions")), + ) + op.create_index( + op.f("ix_game7_transactions_block_hash"), + "game7_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_game7_transactions_block_timestamp"), + "game7_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_game7_transactions_from_address"), + "game7_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_game7_transactions_gas"), "game7_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_game7_transactions_gas_price"), + "game7_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_game7_transactions_hash"), "game7_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_game7_transactions_to_address"), + "game7_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_game7_transactions_value"), + "game7_transactions", + ["value"], + unique=False, + ) + op.create_table( + "imx_zkevm_sepolia_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_imx_zkevm_sepolia_transactions")), + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_block_hash"), + "imx_zkevm_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_block_timestamp"), + "imx_zkevm_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_from_address"), + "imx_zkevm_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_gas"), + "imx_zkevm_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_gas_price"), + "imx_zkevm_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_hash"), + "imx_zkevm_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_to_address"), + "imx_zkevm_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_sepolia_transactions_value"), + "imx_zkevm_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "imx_zkevm_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_imx_zkevm_transactions")), + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_block_hash"), + "imx_zkevm_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_block_timestamp"), + "imx_zkevm_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_from_address"), + "imx_zkevm_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_gas"), + "imx_zkevm_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_gas_price"), + "imx_zkevm_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_hash"), + "imx_zkevm_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_to_address"), + "imx_zkevm_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_imx_zkevm_transactions_value"), + "imx_zkevm_transactions", + ["value"], + unique=False, + ) + op.create_table( + "mantle_sepolia_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_mantle_sepolia_transactions")), + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_block_hash"), + "mantle_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_block_timestamp"), + "mantle_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_from_address"), + "mantle_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_gas"), + "mantle_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_gas_price"), + "mantle_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_hash"), + "mantle_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_to_address"), + "mantle_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_sepolia_transactions_value"), + "mantle_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "mantle_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_mantle_transactions")), + ) + op.create_index( + op.f("ix_mantle_transactions_block_hash"), + "mantle_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_transactions_block_timestamp"), + "mantle_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_transactions_from_address"), + "mantle_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_transactions_gas"), "mantle_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_mantle_transactions_gas_price"), + "mantle_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_transactions_hash"), + "mantle_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_mantle_transactions_to_address"), + "mantle_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_mantle_transactions_value"), + "mantle_transactions", + ["value"], + unique=False, + ) + op.create_table( + "mumbai_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_mumbai_transactions")), + ) + op.create_index( + op.f("ix_mumbai_transactions_block_hash"), + "mumbai_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_mumbai_transactions_block_timestamp"), + "mumbai_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_mumbai_transactions_from_address"), + "mumbai_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_mumbai_transactions_gas"), "mumbai_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_mumbai_transactions_gas_price"), + "mumbai_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_mumbai_transactions_hash"), + "mumbai_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_mumbai_transactions_to_address"), + "mumbai_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_mumbai_transactions_value"), + "mumbai_transactions", + ["value"], + unique=False, + ) + op.create_table( + "polygon_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_polygon_transactions")), + ) + op.create_index( + op.f("ix_polygon_transactions_block_hash"), + "polygon_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_polygon_transactions_block_timestamp"), + "polygon_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_polygon_transactions_from_address"), + "polygon_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_polygon_transactions_gas"), + "polygon_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_polygon_transactions_gas_price"), + "polygon_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_polygon_transactions_hash"), + "polygon_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_polygon_transactions_to_address"), + "polygon_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_polygon_transactions_value"), + "polygon_transactions", + ["value"], + unique=False, + ) + op.create_table( + "proofofplay_apex_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_proofofplay_apex_transactions")), + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_block_hash"), + "proofofplay_apex_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_block_timestamp"), + "proofofplay_apex_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_from_address"), + "proofofplay_apex_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_gas"), + "proofofplay_apex_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_gas_price"), + "proofofplay_apex_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_hash"), + "proofofplay_apex_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_to_address"), + "proofofplay_apex_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_proofofplay_apex_transactions_value"), + "proofofplay_apex_transactions", + ["value"], + unique=False, + ) + op.create_table( + "sepolia_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_sepolia_transactions")), + ) + op.create_index( + op.f("ix_sepolia_transactions_block_hash"), + "sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_sepolia_transactions_block_timestamp"), + "sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_sepolia_transactions_from_address"), + "sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_sepolia_transactions_gas"), + "sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_sepolia_transactions_gas_price"), + "sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_sepolia_transactions_hash"), + "sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_sepolia_transactions_to_address"), + "sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_sepolia_transactions_value"), + "sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "xai_sepolia_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_xai_sepolia_transactions")), + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_block_hash"), + "xai_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_block_timestamp"), + "xai_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_from_address"), + "xai_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_gas"), + "xai_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_gas_price"), + "xai_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_hash"), + "xai_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_to_address"), + "xai_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_xai_sepolia_transactions_value"), + "xai_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "xai_transactions", + sa.Column("l1_block_number", sa.BigInteger(), nullable=True), + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_xai_transactions")), + ) + op.create_index( + op.f("ix_xai_transactions_block_hash"), + "xai_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_xai_transactions_block_timestamp"), + "xai_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_xai_transactions_from_address"), + "xai_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_xai_transactions_gas"), "xai_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_xai_transactions_gas_price"), + "xai_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_xai_transactions_hash"), "xai_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_xai_transactions_to_address"), + "xai_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_xai_transactions_value"), "xai_transactions", ["value"], unique=False + ) + op.create_table( + "xdai_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_xdai_transactions")), + ) + op.create_index( + op.f("ix_xdai_transactions_block_hash"), + "xdai_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_xdai_transactions_block_timestamp"), + "xdai_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_xdai_transactions_from_address"), + "xdai_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_xdai_transactions_gas"), "xdai_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_xdai_transactions_gas_price"), + "xdai_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_xdai_transactions_hash"), "xdai_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_xdai_transactions_to_address"), + "xdai_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_xdai_transactions_value"), "xdai_transactions", ["value"], unique=False + ) + op.create_table( + "zksync_era_sepolia_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint( + "hash", name=op.f("pk_zksync_era_sepolia_transactions") + ), + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_block_hash"), + "zksync_era_sepolia_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_block_timestamp"), + "zksync_era_sepolia_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_from_address"), + "zksync_era_sepolia_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_gas"), + "zksync_era_sepolia_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_gas_price"), + "zksync_era_sepolia_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_hash"), + "zksync_era_sepolia_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_to_address"), + "zksync_era_sepolia_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_sepolia_transactions_value"), + "zksync_era_sepolia_transactions", + ["value"], + unique=False, + ) + op.create_table( + "zksync_era_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_zksync_era_transactions")), + ) + op.create_index( + op.f("ix_zksync_era_transactions_block_hash"), + "zksync_era_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_transactions_block_timestamp"), + "zksync_era_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_transactions_from_address"), + "zksync_era_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_transactions_gas"), + "zksync_era_transactions", + ["gas"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_transactions_gas_price"), + "zksync_era_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_transactions_hash"), + "zksync_era_transactions", + ["hash"], + unique=True, + ) + op.create_index( + op.f("ix_zksync_era_transactions_to_address"), + "zksync_era_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_zksync_era_transactions_value"), + "zksync_era_transactions", + ["value"], + unique=False, + ) + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index( + op.f("ix_zksync_era_transactions_value"), table_name="zksync_era_transactions" + ) + op.drop_index( + op.f("ix_zksync_era_transactions_to_address"), + table_name="zksync_era_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_transactions_hash"), table_name="zksync_era_transactions" + ) + op.drop_index( + op.f("ix_zksync_era_transactions_gas_price"), + table_name="zksync_era_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_transactions_gas"), table_name="zksync_era_transactions" + ) + op.drop_index( + op.f("ix_zksync_era_transactions_from_address"), + table_name="zksync_era_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_transactions_block_timestamp"), + table_name="zksync_era_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_transactions_block_hash"), + table_name="zksync_era_transactions", + ) + op.drop_table("zksync_era_transactions") + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_value"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_to_address"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_hash"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_gas_price"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_gas"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_from_address"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_block_timestamp"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_index( + op.f("ix_zksync_era_sepolia_transactions_block_hash"), + table_name="zksync_era_sepolia_transactions", + ) + op.drop_table("zksync_era_sepolia_transactions") + op.drop_index(op.f("ix_xdai_transactions_value"), table_name="xdai_transactions") + op.drop_index( + op.f("ix_xdai_transactions_to_address"), table_name="xdai_transactions" + ) + op.drop_index(op.f("ix_xdai_transactions_hash"), table_name="xdai_transactions") + op.drop_index( + op.f("ix_xdai_transactions_gas_price"), table_name="xdai_transactions" + ) + op.drop_index(op.f("ix_xdai_transactions_gas"), table_name="xdai_transactions") + op.drop_index( + op.f("ix_xdai_transactions_from_address"), table_name="xdai_transactions" + ) + op.drop_index( + op.f("ix_xdai_transactions_block_timestamp"), table_name="xdai_transactions" + ) + op.drop_index( + op.f("ix_xdai_transactions_block_hash"), table_name="xdai_transactions" + ) + op.drop_table("xdai_transactions") + op.drop_index(op.f("ix_xai_transactions_value"), table_name="xai_transactions") + op.drop_index(op.f("ix_xai_transactions_to_address"), table_name="xai_transactions") + op.drop_index(op.f("ix_xai_transactions_hash"), table_name="xai_transactions") + op.drop_index(op.f("ix_xai_transactions_gas_price"), table_name="xai_transactions") + op.drop_index(op.f("ix_xai_transactions_gas"), table_name="xai_transactions") + op.drop_index( + op.f("ix_xai_transactions_from_address"), table_name="xai_transactions" + ) + op.drop_index( + op.f("ix_xai_transactions_block_timestamp"), table_name="xai_transactions" + ) + op.drop_index(op.f("ix_xai_transactions_block_hash"), table_name="xai_transactions") + op.drop_table("xai_transactions") + op.drop_index( + op.f("ix_xai_sepolia_transactions_value"), table_name="xai_sepolia_transactions" + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_to_address"), + table_name="xai_sepolia_transactions", + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_hash"), table_name="xai_sepolia_transactions" + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_gas_price"), + table_name="xai_sepolia_transactions", + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_gas"), table_name="xai_sepolia_transactions" + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_from_address"), + table_name="xai_sepolia_transactions", + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_block_timestamp"), + table_name="xai_sepolia_transactions", + ) + op.drop_index( + op.f("ix_xai_sepolia_transactions_block_hash"), + table_name="xai_sepolia_transactions", + ) + op.drop_table("xai_sepolia_transactions") + op.drop_index( + op.f("ix_sepolia_transactions_value"), table_name="sepolia_transactions" + ) + op.drop_index( + op.f("ix_sepolia_transactions_to_address"), table_name="sepolia_transactions" + ) + op.drop_index( + op.f("ix_sepolia_transactions_hash"), table_name="sepolia_transactions" + ) + op.drop_index( + op.f("ix_sepolia_transactions_gas_price"), table_name="sepolia_transactions" + ) + op.drop_index( + op.f("ix_sepolia_transactions_gas"), table_name="sepolia_transactions" + ) + op.drop_index( + op.f("ix_sepolia_transactions_from_address"), table_name="sepolia_transactions" + ) + op.drop_index( + op.f("ix_sepolia_transactions_block_timestamp"), + table_name="sepolia_transactions", + ) + op.drop_index( + op.f("ix_sepolia_transactions_block_hash"), table_name="sepolia_transactions" + ) + op.drop_table("sepolia_transactions") + op.drop_index( + op.f("ix_proofofplay_apex_transactions_value"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_to_address"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_hash"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_gas_price"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_gas"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_from_address"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_block_timestamp"), + table_name="proofofplay_apex_transactions", + ) + op.drop_index( + op.f("ix_proofofplay_apex_transactions_block_hash"), + table_name="proofofplay_apex_transactions", + ) + op.drop_table("proofofplay_apex_transactions") + op.drop_index( + op.f("ix_polygon_transactions_value"), table_name="polygon_transactions" + ) + op.drop_index( + op.f("ix_polygon_transactions_to_address"), table_name="polygon_transactions" + ) + op.drop_index( + op.f("ix_polygon_transactions_hash"), table_name="polygon_transactions" + ) + op.drop_index( + op.f("ix_polygon_transactions_gas_price"), table_name="polygon_transactions" + ) + op.drop_index( + op.f("ix_polygon_transactions_gas"), table_name="polygon_transactions" + ) + op.drop_index( + op.f("ix_polygon_transactions_from_address"), table_name="polygon_transactions" + ) + op.drop_index( + op.f("ix_polygon_transactions_block_timestamp"), + table_name="polygon_transactions", + ) + op.drop_index( + op.f("ix_polygon_transactions_block_hash"), table_name="polygon_transactions" + ) + op.drop_table("polygon_transactions") + op.drop_index( + op.f("ix_mumbai_transactions_value"), table_name="mumbai_transactions" + ) + op.drop_index( + op.f("ix_mumbai_transactions_to_address"), table_name="mumbai_transactions" + ) + op.drop_index(op.f("ix_mumbai_transactions_hash"), table_name="mumbai_transactions") + op.drop_index( + op.f("ix_mumbai_transactions_gas_price"), table_name="mumbai_transactions" + ) + op.drop_index(op.f("ix_mumbai_transactions_gas"), table_name="mumbai_transactions") + op.drop_index( + op.f("ix_mumbai_transactions_from_address"), table_name="mumbai_transactions" + ) + op.drop_index( + op.f("ix_mumbai_transactions_block_timestamp"), table_name="mumbai_transactions" + ) + op.drop_index( + op.f("ix_mumbai_transactions_block_hash"), table_name="mumbai_transactions" + ) + op.drop_table("mumbai_transactions") + op.drop_index( + op.f("ix_mantle_transactions_value"), table_name="mantle_transactions" + ) + op.drop_index( + op.f("ix_mantle_transactions_to_address"), table_name="mantle_transactions" + ) + op.drop_index(op.f("ix_mantle_transactions_hash"), table_name="mantle_transactions") + op.drop_index( + op.f("ix_mantle_transactions_gas_price"), table_name="mantle_transactions" + ) + op.drop_index(op.f("ix_mantle_transactions_gas"), table_name="mantle_transactions") + op.drop_index( + op.f("ix_mantle_transactions_from_address"), table_name="mantle_transactions" + ) + op.drop_index( + op.f("ix_mantle_transactions_block_timestamp"), table_name="mantle_transactions" + ) + op.drop_index( + op.f("ix_mantle_transactions_block_hash"), table_name="mantle_transactions" + ) + op.drop_table("mantle_transactions") + op.drop_index( + op.f("ix_mantle_sepolia_transactions_value"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_to_address"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_hash"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_gas_price"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_gas"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_from_address"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_block_timestamp"), + table_name="mantle_sepolia_transactions", + ) + op.drop_index( + op.f("ix_mantle_sepolia_transactions_block_hash"), + table_name="mantle_sepolia_transactions", + ) + op.drop_table("mantle_sepolia_transactions") + op.drop_index( + op.f("ix_imx_zkevm_transactions_value"), table_name="imx_zkevm_transactions" + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_to_address"), + table_name="imx_zkevm_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_hash"), table_name="imx_zkevm_transactions" + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_gas_price"), table_name="imx_zkevm_transactions" + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_gas"), table_name="imx_zkevm_transactions" + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_from_address"), + table_name="imx_zkevm_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_block_timestamp"), + table_name="imx_zkevm_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_transactions_block_hash"), + table_name="imx_zkevm_transactions", + ) + op.drop_table("imx_zkevm_transactions") + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_value"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_to_address"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_hash"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_gas_price"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_gas"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_from_address"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_block_timestamp"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_index( + op.f("ix_imx_zkevm_sepolia_transactions_block_hash"), + table_name="imx_zkevm_sepolia_transactions", + ) + op.drop_table("imx_zkevm_sepolia_transactions") + op.drop_index(op.f("ix_game7_transactions_value"), table_name="game7_transactions") + op.drop_index( + op.f("ix_game7_transactions_to_address"), table_name="game7_transactions" + ) + op.drop_index(op.f("ix_game7_transactions_hash"), table_name="game7_transactions") + op.drop_index( + op.f("ix_game7_transactions_gas_price"), table_name="game7_transactions" + ) + op.drop_index(op.f("ix_game7_transactions_gas"), table_name="game7_transactions") + op.drop_index( + op.f("ix_game7_transactions_from_address"), table_name="game7_transactions" + ) + op.drop_index( + op.f("ix_game7_transactions_block_timestamp"), table_name="game7_transactions" + ) + op.drop_index( + op.f("ix_game7_transactions_block_hash"), table_name="game7_transactions" + ) + op.drop_table("game7_transactions") + op.drop_index( + op.f("ix_game7_testnet_transactions_value"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_to_address"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_hash"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_gas_price"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_gas"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_from_address"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_block_timestamp"), + table_name="game7_testnet_transactions", + ) + op.drop_index( + op.f("ix_game7_testnet_transactions_block_hash"), + table_name="game7_testnet_transactions", + ) + op.drop_table("game7_testnet_transactions") + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_value"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_to_address"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_hash"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas_price"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_from_address"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_timestamp"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_hash"), + table_name="game7_orbit_arbitrum_sepolia_transactions", + ) + op.drop_table("game7_orbit_arbitrum_sepolia_transactions") + op.drop_index( + op.f("ix_ethereum_transactions_value"), table_name="ethereum_transactions" + ) + op.drop_index( + op.f("ix_ethereum_transactions_to_address"), table_name="ethereum_transactions" + ) + op.drop_index( + op.f("ix_ethereum_transactions_hash"), table_name="ethereum_transactions" + ) + op.drop_index( + op.f("ix_ethereum_transactions_gas_price"), table_name="ethereum_transactions" + ) + op.drop_index( + op.f("ix_ethereum_transactions_gas"), table_name="ethereum_transactions" + ) + op.drop_index( + op.f("ix_ethereum_transactions_from_address"), + table_name="ethereum_transactions", + ) + op.drop_index( + op.f("ix_ethereum_transactions_block_timestamp"), + table_name="ethereum_transactions", + ) + op.drop_index( + op.f("ix_ethereum_transactions_block_hash"), table_name="ethereum_transactions" + ) + op.drop_table("ethereum_transactions") + op.drop_index(op.f("ix_blast_transactions_value"), table_name="blast_transactions") + op.drop_index( + op.f("ix_blast_transactions_to_address"), table_name="blast_transactions" + ) + op.drop_index(op.f("ix_blast_transactions_hash"), table_name="blast_transactions") + op.drop_index( + op.f("ix_blast_transactions_gas_price"), table_name="blast_transactions" + ) + op.drop_index(op.f("ix_blast_transactions_gas"), table_name="blast_transactions") + op.drop_index( + op.f("ix_blast_transactions_from_address"), table_name="blast_transactions" + ) + op.drop_index( + op.f("ix_blast_transactions_block_timestamp"), table_name="blast_transactions" + ) + op.drop_index( + op.f("ix_blast_transactions_block_hash"), table_name="blast_transactions" + ) + op.drop_table("blast_transactions") + op.drop_index( + op.f("ix_blast_sepolia_transactions_value"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_to_address"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_hash"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_gas_price"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_gas"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_from_address"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_block_timestamp"), + table_name="blast_sepolia_transactions", + ) + op.drop_index( + op.f("ix_blast_sepolia_transactions_block_hash"), + table_name="blast_sepolia_transactions", + ) + op.drop_table("blast_sepolia_transactions") + op.drop_index(op.f("ix_base_transactions_value"), table_name="base_transactions") + op.drop_index( + op.f("ix_base_transactions_to_address"), table_name="base_transactions" + ) + op.drop_index(op.f("ix_base_transactions_hash"), table_name="base_transactions") + op.drop_index( + op.f("ix_base_transactions_gas_price"), table_name="base_transactions" + ) + op.drop_index(op.f("ix_base_transactions_gas"), table_name="base_transactions") + op.drop_index( + op.f("ix_base_transactions_from_address"), table_name="base_transactions" + ) + op.drop_index( + op.f("ix_base_transactions_block_timestamp"), table_name="base_transactions" + ) + op.drop_index( + op.f("ix_base_transactions_block_hash"), table_name="base_transactions" + ) + op.drop_table("base_transactions") + op.drop_index(op.f("ix_b3_transactions_value"), table_name="b3_transactions") + op.drop_index(op.f("ix_b3_transactions_to_address"), table_name="b3_transactions") + op.drop_index(op.f("ix_b3_transactions_hash"), table_name="b3_transactions") + op.drop_index(op.f("ix_b3_transactions_gas_price"), table_name="b3_transactions") + op.drop_index(op.f("ix_b3_transactions_gas"), table_name="b3_transactions") + op.drop_index(op.f("ix_b3_transactions_from_address"), table_name="b3_transactions") + op.drop_index( + op.f("ix_b3_transactions_block_timestamp"), table_name="b3_transactions" + ) + op.drop_index(op.f("ix_b3_transactions_block_hash"), table_name="b3_transactions") + op.drop_table("b3_transactions") + op.drop_index( + op.f("ix_b3_sepolia_transactions_value"), table_name="b3_sepolia_transactions" + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_to_address"), + table_name="b3_sepolia_transactions", + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_hash"), table_name="b3_sepolia_transactions" + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_gas_price"), + table_name="b3_sepolia_transactions", + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_gas"), table_name="b3_sepolia_transactions" + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_from_address"), + table_name="b3_sepolia_transactions", + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_block_timestamp"), + table_name="b3_sepolia_transactions", + ) + op.drop_index( + op.f("ix_b3_sepolia_transactions_block_hash"), + table_name="b3_sepolia_transactions", + ) + op.drop_table("b3_sepolia_transactions") + op.drop_index( + op.f("ix_avalanche_transactions_value"), table_name="avalanche_transactions" + ) + op.drop_index( + op.f("ix_avalanche_transactions_to_address"), + table_name="avalanche_transactions", + ) + op.drop_index( + op.f("ix_avalanche_transactions_hash"), table_name="avalanche_transactions" + ) + op.drop_index( + op.f("ix_avalanche_transactions_gas_price"), table_name="avalanche_transactions" + ) + op.drop_index( + op.f("ix_avalanche_transactions_gas"), table_name="avalanche_transactions" + ) + op.drop_index( + op.f("ix_avalanche_transactions_from_address"), + table_name="avalanche_transactions", + ) + op.drop_index( + op.f("ix_avalanche_transactions_block_timestamp"), + table_name="avalanche_transactions", + ) + op.drop_index( + op.f("ix_avalanche_transactions_block_hash"), + table_name="avalanche_transactions", + ) + op.drop_table("avalanche_transactions") + op.drop_index( + op.f("ix_avalanche_fuji_transactions_value"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_to_address"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_hash"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_gas_price"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_gas"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_from_address"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_block_timestamp"), + table_name="avalanche_fuji_transactions", + ) + op.drop_index( + op.f("ix_avalanche_fuji_transactions_block_hash"), + table_name="avalanche_fuji_transactions", + ) + op.drop_table("avalanche_fuji_transactions") + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_value"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_to_address"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_hash"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_gas_price"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_gas"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_from_address"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_block_timestamp"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_sepolia_transactions_block_hash"), + table_name="arbitrum_sepolia_transactions", + ) + op.drop_table("arbitrum_sepolia_transactions") + op.drop_index( + op.f("ix_arbitrum_one_transactions_value"), + table_name="arbitrum_one_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_to_address"), + table_name="arbitrum_one_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_hash"), + table_name="arbitrum_one_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_gas_price"), + table_name="arbitrum_one_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_gas"), table_name="arbitrum_one_transactions" + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_from_address"), + table_name="arbitrum_one_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_block_timestamp"), + table_name="arbitrum_one_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_one_transactions_block_hash"), + table_name="arbitrum_one_transactions", + ) + op.drop_table("arbitrum_one_transactions") + op.drop_index( + op.f("ix_arbitrum_nova_transactions_value"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_to_address"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_hash"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_gas_price"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_gas"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_from_address"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_block_timestamp"), + table_name="arbitrum_nova_transactions", + ) + op.drop_index( + op.f("ix_arbitrum_nova_transactions_block_hash"), + table_name="arbitrum_nova_transactions", + ) + op.drop_table("arbitrum_nova_transactions") + op.drop_index(op.f("ix_amoy_transactions_value"), table_name="amoy_transactions") + op.drop_index( + op.f("ix_amoy_transactions_to_address"), table_name="amoy_transactions" + ) + op.drop_index(op.f("ix_amoy_transactions_hash"), table_name="amoy_transactions") + op.drop_index( + op.f("ix_amoy_transactions_gas_price"), table_name="amoy_transactions" + ) + op.drop_index(op.f("ix_amoy_transactions_gas"), table_name="amoy_transactions") + op.drop_index( + op.f("ix_amoy_transactions_from_address"), table_name="amoy_transactions" + ) + op.drop_index( + op.f("ix_amoy_transactions_block_timestamp"), table_name="amoy_transactions" + ) + op.drop_index( + op.f("ix_amoy_transactions_block_hash"), table_name="amoy_transactions" + ) + op.drop_table("amoy_transactions") + # ### end Alembic commands ### From 0cca9372277939f687778e0b057ab85ce02c1e34 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 11 Nov 2024 15:25:52 +0200 Subject: [PATCH 3/6] Fix missing model. --- moonstreamdb-v3/moonstreamdbv3/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonstreamdb-v3/moonstreamdbv3/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index 353cda776..afcafa4c5 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -744,8 +744,8 @@ class ArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore ) -class ArbitrumOneSepoliaLabel(EvmBasedLabel): # type: ignore - __tablename__ = "arbitrum_one_sepolia_labels" +class ArbitrumSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "arbitrum_sepolia_transactions" l1_block_number = Column(BigInteger, nullable=True) From 6b518fb9809a51786392183e9aa8bf15de98a228 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 13 Nov 2024 12:11:21 +0200 Subject: [PATCH 4/6] Update migration. --- ...y => a6580c96ae2c_add_raw_transactions.py} | 97 +++++++++++++++++-- 1 file changed, 91 insertions(+), 6 deletions(-) rename moonstreamdb-v3/moonstreamdbv3/alembic/versions/{d13b6bb1d214_add_transactions.py => a6580c96ae2c_add_raw_transactions.py} (96%) diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py similarity index 96% rename from moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py rename to moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py index 27e47df22..f1b982980 100644 --- a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/d13b6bb1d214_add_transactions.py +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py @@ -1,8 +1,8 @@ -"""add transactions +"""add raw transactions -Revision ID: d13b6bb1d214 -Revises: d816689b786a -Create Date: 2024-11-10 23:34:21.581396 +Revision ID: a6580c96ae2c +Revises: e6d3c285e7cc +Create Date: 2024-11-13 11:56:48.605875 """ @@ -13,8 +13,8 @@ from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. -revision: str = "d13b6bb1d214" -down_revision: Union[str, None] = "d816689b786a" +revision: str = "a6580c96ae2c" +down_revision: Union[str, None] = "e6d3c285e7cc" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None @@ -1569,6 +1569,72 @@ def upgrade() -> None: ["value"], unique=False, ) + op.create_table( + "ronin_transactions", + sa.Column("hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("block_timestamp", sa.BigInteger(), nullable=False), + sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), + sa.Column("from_address", sa.LargeBinary(), nullable=True), + sa.Column("to_address", sa.LargeBinary(), nullable=True), + sa.Column("gas", sa.BigInteger(), nullable=True), + sa.Column("gas_price", sa.BigInteger(), nullable=True), + sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), + sa.Column("input", sa.Text(), nullable=True), + sa.Column("nonce", sa.BigInteger(), nullable=True), + sa.Column("transaction_index", sa.BigInteger(), nullable=True), + sa.Column("transaction_type", sa.Integer(), nullable=True), + sa.Column("value", sa.BigInteger(), nullable=True), + sa.Column( + "indexed_at", + sa.DateTime(timezone=True), + server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), + nullable=False, + ), + sa.PrimaryKeyConstraint("hash", name=op.f("pk_ronin_transactions")), + ) + op.create_index( + op.f("ix_ronin_transactions_block_hash"), + "ronin_transactions", + ["block_hash"], + unique=False, + ) + op.create_index( + op.f("ix_ronin_transactions_block_timestamp"), + "ronin_transactions", + ["block_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_ronin_transactions_from_address"), + "ronin_transactions", + ["from_address"], + unique=False, + ) + op.create_index( + op.f("ix_ronin_transactions_gas"), "ronin_transactions", ["gas"], unique=False + ) + op.create_index( + op.f("ix_ronin_transactions_gas_price"), + "ronin_transactions", + ["gas_price"], + unique=False, + ) + op.create_index( + op.f("ix_ronin_transactions_hash"), "ronin_transactions", ["hash"], unique=True + ) + op.create_index( + op.f("ix_ronin_transactions_to_address"), + "ronin_transactions", + ["to_address"], + unique=False, + ) + op.create_index( + op.f("ix_ronin_transactions_value"), + "ronin_transactions", + ["value"], + unique=False, + ) op.create_table( "sepolia_transactions", sa.Column("hash", sa.VARCHAR(length=256), nullable=False), @@ -2142,6 +2208,25 @@ def downgrade() -> None: op.f("ix_sepolia_transactions_block_hash"), table_name="sepolia_transactions" ) op.drop_table("sepolia_transactions") + op.drop_index(op.f("ix_ronin_transactions_value"), table_name="ronin_transactions") + op.drop_index( + op.f("ix_ronin_transactions_to_address"), table_name="ronin_transactions" + ) + op.drop_index(op.f("ix_ronin_transactions_hash"), table_name="ronin_transactions") + op.drop_index( + op.f("ix_ronin_transactions_gas_price"), table_name="ronin_transactions" + ) + op.drop_index(op.f("ix_ronin_transactions_gas"), table_name="ronin_transactions") + op.drop_index( + op.f("ix_ronin_transactions_from_address"), table_name="ronin_transactions" + ) + op.drop_index( + op.f("ix_ronin_transactions_block_timestamp"), table_name="ronin_transactions" + ) + op.drop_index( + op.f("ix_ronin_transactions_block_hash"), table_name="ronin_transactions" + ) + op.drop_table("ronin_transactions") op.drop_index( op.f("ix_proofofplay_apex_transactions_value"), table_name="proofofplay_apex_transactions", From 96fd9a1e80ba80947d52bd3f9642661b6f4c3baa Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 19 Nov 2024 15:07:36 +0200 Subject: [PATCH 5/6] Update model. --- moonstreamdb-v3/moonstreamdbv3/models.py | 42 ++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/moonstreamdb-v3/moonstreamdbv3/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index 4171eed75..5deec0aab 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -27,6 +27,7 @@ Integer, LargeBinary, MetaData, + Numeric, Text, ) from sqlalchemy.dialects.postgresql import JSONB, UUID @@ -124,6 +125,35 @@ class EvmBasedLabel(Base): # type: ignore ) +# class EthereumTransaction(Base): # type: ignore +# __tablename__ = "ethereum_transactions" + +# hash = Column( +# VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True +# ) +# block_number = Column( +# BigInteger, +# ForeignKey("ethereum_blocks.block_number", ondelete="CASCADE"), +# nullable=False, +# index=True, +# ) +# from_address = Column(VARCHAR(256), index=True) +# to_address = Column(VARCHAR(256), index=True) +# gas = Column(Numeric(precision=78, scale=0), index=True) +# gas_price = Column(Numeric(precision=78, scale=0), index=True) +# max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True) +# max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True) +# 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( +# DateTime(timezone=True), server_default=utcnow(), nullable=False +# ) + + class EvmBasedTransaction(Base): # type: ignore __abstract__ = True @@ -141,15 +171,15 @@ class EvmBasedTransaction(Base): # type: ignore block_hash = Column(VARCHAR(256), nullable=False, index=True) from_address = Column(LargeBinary, index=True) to_address = Column(LargeBinary, index=True) - gas = Column(BigInteger, index=True) - gas_price = Column(BigInteger, index=True) - max_fee_per_gas = Column(BigInteger, nullable=True) - max_priority_fee_per_gas = Column(BigInteger, nullable=True) + gas = Column(Numeric(precision=78, scale=0), index=True) + gas_price = Column(Numeric(precision=78, scale=0), index=True) + max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True) + max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True) input = Column(Text) - nonce = Column(BigInteger) + nonce = Column(VARCHAR(256)) transaction_index = Column(BigInteger) transaction_type = Column(Integer, nullable=True) - value = Column(BigInteger, index=True) + value = Column(Numeric(precision=78, scale=0), index=True) indexed_at = Column( DateTime(timezone=True), server_default=utcnow(), nullable=False From b9c28b00e9f0c483b1487916dc581b0849ebc4b3 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 16 Jan 2025 15:07:47 +0200 Subject: [PATCH 6/6] Update model. --- .../3ea877d6e22d_add_raw_transactions.py | 1177 +++++++ .../a6580c96ae2c_add_raw_transactions.py | 2829 ----------------- moonstreamdb-v3/moonstreamdbv3/models.py | 43 +- 3 files changed, 1185 insertions(+), 2864 deletions(-) create mode 100644 moonstreamdb-v3/moonstreamdbv3/alembic/versions/3ea877d6e22d_add_raw_transactions.py delete mode 100644 moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/3ea877d6e22d_add_raw_transactions.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/3ea877d6e22d_add_raw_transactions.py new file mode 100644 index 000000000..01d303bd3 --- /dev/null +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/3ea877d6e22d_add_raw_transactions.py @@ -0,0 +1,1177 @@ +"""Add raw transactions + +Revision ID: 3ea877d6e22d +Revises: dae735afc98f +Create Date: 2025-01-16 12:47:48.572482 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision: str = '3ea877d6e22d' +down_revision: Union[str, None] = 'dae735afc98f' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('amoy_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_amoy_transactions')) + ) + op.create_index(op.f('ix_amoy_transactions_block_hash'), 'amoy_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_amoy_transactions_block_number'), 'amoy_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_amoy_transactions_block_timestamp'), 'amoy_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_amoy_transactions_from_address'), 'amoy_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_amoy_transactions_gas'), 'amoy_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_amoy_transactions_gas_price'), 'amoy_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_amoy_transactions_hash'), 'amoy_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_amoy_transactions_to_address'), 'amoy_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_amoy_transactions_value'), 'amoy_transactions', ['value'], unique=False) + op.create_table('arbitrum_nova_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_arbitrum_nova_transactions')) + ) + op.create_index(op.f('ix_arbitrum_nova_transactions_block_hash'), 'arbitrum_nova_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_block_number'), 'arbitrum_nova_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_block_timestamp'), 'arbitrum_nova_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_from_address'), 'arbitrum_nova_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_gas'), 'arbitrum_nova_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_gas_price'), 'arbitrum_nova_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_hash'), 'arbitrum_nova_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_arbitrum_nova_transactions_to_address'), 'arbitrum_nova_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_arbitrum_nova_transactions_value'), 'arbitrum_nova_transactions', ['value'], unique=False) + op.create_table('arbitrum_one_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_arbitrum_one_transactions')) + ) + op.create_index(op.f('ix_arbitrum_one_transactions_block_hash'), 'arbitrum_one_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_block_number'), 'arbitrum_one_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_block_timestamp'), 'arbitrum_one_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_from_address'), 'arbitrum_one_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_gas'), 'arbitrum_one_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_gas_price'), 'arbitrum_one_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_hash'), 'arbitrum_one_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_arbitrum_one_transactions_to_address'), 'arbitrum_one_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_arbitrum_one_transactions_value'), 'arbitrum_one_transactions', ['value'], unique=False) + op.create_table('arbitrum_sepolia_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_arbitrum_sepolia_transactions')) + ) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_block_hash'), 'arbitrum_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_block_number'), 'arbitrum_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_block_timestamp'), 'arbitrum_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_from_address'), 'arbitrum_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_gas'), 'arbitrum_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_gas_price'), 'arbitrum_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_hash'), 'arbitrum_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_to_address'), 'arbitrum_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_arbitrum_sepolia_transactions_value'), 'arbitrum_sepolia_transactions', ['value'], unique=False) + op.create_table('avalanche_fuji_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_avalanche_fuji_transactions')) + ) + op.create_index(op.f('ix_avalanche_fuji_transactions_block_hash'), 'avalanche_fuji_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_block_number'), 'avalanche_fuji_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_block_timestamp'), 'avalanche_fuji_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_from_address'), 'avalanche_fuji_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_gas'), 'avalanche_fuji_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_gas_price'), 'avalanche_fuji_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_hash'), 'avalanche_fuji_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_avalanche_fuji_transactions_to_address'), 'avalanche_fuji_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_avalanche_fuji_transactions_value'), 'avalanche_fuji_transactions', ['value'], unique=False) + op.create_table('avalanche_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_avalanche_transactions')) + ) + op.create_index(op.f('ix_avalanche_transactions_block_hash'), 'avalanche_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_block_number'), 'avalanche_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_block_timestamp'), 'avalanche_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_from_address'), 'avalanche_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_gas'), 'avalanche_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_gas_price'), 'avalanche_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_hash'), 'avalanche_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_avalanche_transactions_to_address'), 'avalanche_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_avalanche_transactions_value'), 'avalanche_transactions', ['value'], unique=False) + op.create_table('b3_sepolia_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_b3_sepolia_transactions')) + ) + op.create_index(op.f('ix_b3_sepolia_transactions_block_hash'), 'b3_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_block_number'), 'b3_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_block_timestamp'), 'b3_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_from_address'), 'b3_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_gas'), 'b3_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_gas_price'), 'b3_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_hash'), 'b3_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_b3_sepolia_transactions_to_address'), 'b3_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_b3_sepolia_transactions_value'), 'b3_sepolia_transactions', ['value'], unique=False) + op.create_table('b3_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_b3_transactions')) + ) + op.create_index(op.f('ix_b3_transactions_block_hash'), 'b3_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_b3_transactions_block_number'), 'b3_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_b3_transactions_block_timestamp'), 'b3_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_b3_transactions_from_address'), 'b3_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_b3_transactions_gas'), 'b3_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_b3_transactions_gas_price'), 'b3_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_b3_transactions_hash'), 'b3_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_b3_transactions_to_address'), 'b3_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_b3_transactions_value'), 'b3_transactions', ['value'], unique=False) + op.create_table('base_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_base_transactions')) + ) + op.create_index(op.f('ix_base_transactions_block_hash'), 'base_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_base_transactions_block_number'), 'base_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_base_transactions_block_timestamp'), 'base_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_base_transactions_from_address'), 'base_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_base_transactions_gas'), 'base_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_base_transactions_gas_price'), 'base_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_base_transactions_hash'), 'base_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_base_transactions_to_address'), 'base_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_base_transactions_value'), 'base_transactions', ['value'], unique=False) + op.create_table('blast_sepolia_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_blast_sepolia_transactions')) + ) + op.create_index(op.f('ix_blast_sepolia_transactions_block_hash'), 'blast_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_block_number'), 'blast_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_block_timestamp'), 'blast_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_from_address'), 'blast_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_gas'), 'blast_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_gas_price'), 'blast_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_hash'), 'blast_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_blast_sepolia_transactions_to_address'), 'blast_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_blast_sepolia_transactions_value'), 'blast_sepolia_transactions', ['value'], unique=False) + op.create_table('blast_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_blast_transactions')) + ) + op.create_index(op.f('ix_blast_transactions_block_hash'), 'blast_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_blast_transactions_block_number'), 'blast_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_blast_transactions_block_timestamp'), 'blast_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_blast_transactions_from_address'), 'blast_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_blast_transactions_gas'), 'blast_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_blast_transactions_gas_price'), 'blast_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_blast_transactions_hash'), 'blast_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_blast_transactions_to_address'), 'blast_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_blast_transactions_value'), 'blast_transactions', ['value'], unique=False) + op.create_table('ethereum_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_ethereum_transactions')) + ) + op.create_index(op.f('ix_ethereum_transactions_block_hash'), 'ethereum_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_block_number'), 'ethereum_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_block_timestamp'), 'ethereum_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_from_address'), 'ethereum_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_gas'), 'ethereum_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_gas_price'), 'ethereum_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_hash'), 'ethereum_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_ethereum_transactions_to_address'), 'ethereum_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_ethereum_transactions_value'), 'ethereum_transactions', ['value'], unique=False) + op.create_table('game7_orbit_arbitrum_sepolia_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_game7_orbit_arbitrum_sepolia_transactions')) + ) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_block_hash'), 'game7_orbit_arbitrum_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_block_number'), 'game7_orbit_arbitrum_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_block_timestamp'), 'game7_orbit_arbitrum_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_from_address'), 'game7_orbit_arbitrum_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_gas'), 'game7_orbit_arbitrum_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_gas_price'), 'game7_orbit_arbitrum_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_hash'), 'game7_orbit_arbitrum_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_to_address'), 'game7_orbit_arbitrum_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_value'), 'game7_orbit_arbitrum_sepolia_transactions', ['value'], unique=False) + op.create_table('game7_testnet_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_game7_testnet_transactions')) + ) + op.create_index(op.f('ix_game7_testnet_transactions_block_hash'), 'game7_testnet_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_block_number'), 'game7_testnet_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_block_timestamp'), 'game7_testnet_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_from_address'), 'game7_testnet_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_gas'), 'game7_testnet_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_gas_price'), 'game7_testnet_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_hash'), 'game7_testnet_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_game7_testnet_transactions_to_address'), 'game7_testnet_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_game7_testnet_transactions_value'), 'game7_testnet_transactions', ['value'], unique=False) + op.create_table('game7_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_game7_transactions')) + ) + op.create_index(op.f('ix_game7_transactions_block_hash'), 'game7_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_game7_transactions_block_number'), 'game7_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_game7_transactions_block_timestamp'), 'game7_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_game7_transactions_from_address'), 'game7_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_game7_transactions_gas'), 'game7_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_game7_transactions_gas_price'), 'game7_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_game7_transactions_hash'), 'game7_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_game7_transactions_to_address'), 'game7_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_game7_transactions_value'), 'game7_transactions', ['value'], unique=False) + op.create_table('imx_zkevm_sepolia_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_imx_zkevm_sepolia_transactions')) + ) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_block_hash'), 'imx_zkevm_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_block_number'), 'imx_zkevm_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_block_timestamp'), 'imx_zkevm_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_from_address'), 'imx_zkevm_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_gas'), 'imx_zkevm_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_gas_price'), 'imx_zkevm_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_hash'), 'imx_zkevm_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_to_address'), 'imx_zkevm_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_imx_zkevm_sepolia_transactions_value'), 'imx_zkevm_sepolia_transactions', ['value'], unique=False) + op.create_table('imx_zkevm_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_imx_zkevm_transactions')) + ) + op.create_index(op.f('ix_imx_zkevm_transactions_block_hash'), 'imx_zkevm_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_block_number'), 'imx_zkevm_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_block_timestamp'), 'imx_zkevm_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_from_address'), 'imx_zkevm_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_gas'), 'imx_zkevm_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_gas_price'), 'imx_zkevm_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_hash'), 'imx_zkevm_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_imx_zkevm_transactions_to_address'), 'imx_zkevm_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_imx_zkevm_transactions_value'), 'imx_zkevm_transactions', ['value'], unique=False) + op.create_table('mantle_sepolia_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_mantle_sepolia_transactions')) + ) + op.create_index(op.f('ix_mantle_sepolia_transactions_block_hash'), 'mantle_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_block_number'), 'mantle_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_block_timestamp'), 'mantle_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_from_address'), 'mantle_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_gas'), 'mantle_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_gas_price'), 'mantle_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_hash'), 'mantle_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_mantle_sepolia_transactions_to_address'), 'mantle_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_mantle_sepolia_transactions_value'), 'mantle_sepolia_transactions', ['value'], unique=False) + op.create_table('mantle_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_mantle_transactions')) + ) + op.create_index(op.f('ix_mantle_transactions_block_hash'), 'mantle_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_mantle_transactions_block_number'), 'mantle_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_mantle_transactions_block_timestamp'), 'mantle_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_mantle_transactions_from_address'), 'mantle_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_mantle_transactions_gas'), 'mantle_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_mantle_transactions_gas_price'), 'mantle_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_mantle_transactions_hash'), 'mantle_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_mantle_transactions_to_address'), 'mantle_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_mantle_transactions_value'), 'mantle_transactions', ['value'], unique=False) + op.create_table('mumbai_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_mumbai_transactions')) + ) + op.create_index(op.f('ix_mumbai_transactions_block_hash'), 'mumbai_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_block_number'), 'mumbai_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_block_timestamp'), 'mumbai_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_from_address'), 'mumbai_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_gas'), 'mumbai_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_gas_price'), 'mumbai_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_hash'), 'mumbai_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_mumbai_transactions_to_address'), 'mumbai_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_mumbai_transactions_value'), 'mumbai_transactions', ['value'], unique=False) + op.create_table('polygon_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_polygon_transactions')) + ) + op.create_index(op.f('ix_polygon_transactions_block_hash'), 'polygon_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_polygon_transactions_block_number'), 'polygon_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_polygon_transactions_block_timestamp'), 'polygon_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_polygon_transactions_from_address'), 'polygon_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_polygon_transactions_gas'), 'polygon_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_polygon_transactions_gas_price'), 'polygon_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_polygon_transactions_hash'), 'polygon_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_polygon_transactions_to_address'), 'polygon_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_polygon_transactions_value'), 'polygon_transactions', ['value'], unique=False) + op.create_table('proofofplay_apex_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_proofofplay_apex_transactions')) + ) + op.create_index(op.f('ix_proofofplay_apex_transactions_block_hash'), 'proofofplay_apex_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_block_number'), 'proofofplay_apex_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_block_timestamp'), 'proofofplay_apex_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_from_address'), 'proofofplay_apex_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_gas'), 'proofofplay_apex_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_gas_price'), 'proofofplay_apex_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_hash'), 'proofofplay_apex_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_proofofplay_apex_transactions_to_address'), 'proofofplay_apex_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_proofofplay_apex_transactions_value'), 'proofofplay_apex_transactions', ['value'], unique=False) + op.create_table('ronin_saigon_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_ronin_saigon_transactions')) + ) + op.create_index(op.f('ix_ronin_saigon_transactions_block_hash'), 'ronin_saigon_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_block_number'), 'ronin_saigon_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_block_timestamp'), 'ronin_saigon_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_from_address'), 'ronin_saigon_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_gas'), 'ronin_saigon_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_gas_price'), 'ronin_saigon_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_hash'), 'ronin_saigon_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_ronin_saigon_transactions_to_address'), 'ronin_saigon_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_ronin_saigon_transactions_value'), 'ronin_saigon_transactions', ['value'], unique=False) + op.create_table('ronin_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_ronin_transactions')) + ) + op.create_index(op.f('ix_ronin_transactions_block_hash'), 'ronin_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_ronin_transactions_block_number'), 'ronin_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_ronin_transactions_block_timestamp'), 'ronin_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_ronin_transactions_from_address'), 'ronin_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_ronin_transactions_gas'), 'ronin_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_ronin_transactions_gas_price'), 'ronin_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_ronin_transactions_hash'), 'ronin_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_ronin_transactions_to_address'), 'ronin_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_ronin_transactions_value'), 'ronin_transactions', ['value'], unique=False) + op.create_table('sepolia_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_sepolia_transactions')) + ) + op.create_index(op.f('ix_sepolia_transactions_block_hash'), 'sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_block_number'), 'sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_block_timestamp'), 'sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_from_address'), 'sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_gas'), 'sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_gas_price'), 'sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_hash'), 'sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_sepolia_transactions_to_address'), 'sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_sepolia_transactions_value'), 'sepolia_transactions', ['value'], unique=False) + op.create_table('xai_sepolia_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_xai_sepolia_transactions')) + ) + op.create_index(op.f('ix_xai_sepolia_transactions_block_hash'), 'xai_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_block_number'), 'xai_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_block_timestamp'), 'xai_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_from_address'), 'xai_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_gas'), 'xai_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_gas_price'), 'xai_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_hash'), 'xai_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_xai_sepolia_transactions_to_address'), 'xai_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_xai_sepolia_transactions_value'), 'xai_sepolia_transactions', ['value'], unique=False) + op.create_table('xai_transactions', + sa.Column('l1_block_number', sa.BigInteger(), nullable=True), + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_xai_transactions')) + ) + op.create_index(op.f('ix_xai_transactions_block_hash'), 'xai_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_xai_transactions_block_number'), 'xai_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_xai_transactions_block_timestamp'), 'xai_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_xai_transactions_from_address'), 'xai_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_xai_transactions_gas'), 'xai_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_xai_transactions_gas_price'), 'xai_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_xai_transactions_hash'), 'xai_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_xai_transactions_to_address'), 'xai_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_xai_transactions_value'), 'xai_transactions', ['value'], unique=False) + op.create_table('xdai_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_xdai_transactions')) + ) + op.create_index(op.f('ix_xdai_transactions_block_hash'), 'xdai_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_xdai_transactions_block_number'), 'xdai_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_xdai_transactions_block_timestamp'), 'xdai_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_xdai_transactions_from_address'), 'xdai_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_xdai_transactions_gas'), 'xdai_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_xdai_transactions_gas_price'), 'xdai_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_xdai_transactions_hash'), 'xdai_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_xdai_transactions_to_address'), 'xdai_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_xdai_transactions_value'), 'xdai_transactions', ['value'], unique=False) + op.create_table('zksync_era_sepolia_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_zksync_era_sepolia_transactions')) + ) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_block_hash'), 'zksync_era_sepolia_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_block_number'), 'zksync_era_sepolia_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_block_timestamp'), 'zksync_era_sepolia_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_from_address'), 'zksync_era_sepolia_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_gas'), 'zksync_era_sepolia_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_gas_price'), 'zksync_era_sepolia_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_hash'), 'zksync_era_sepolia_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_to_address'), 'zksync_era_sepolia_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_zksync_era_sepolia_transactions_value'), 'zksync_era_sepolia_transactions', ['value'], unique=False) + op.create_table('zksync_era_transactions', + sa.Column('hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('block_number', sa.BigInteger(), nullable=False), + sa.Column('block_timestamp', sa.BigInteger(), nullable=False), + sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False), + sa.Column('from_address', sa.LargeBinary(), nullable=True), + sa.Column('to_address', sa.LargeBinary(), nullable=True), + sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('input', sa.Text(), nullable=True), + sa.Column('nonce', sa.VARCHAR(length=256), nullable=True), + sa.Column('transaction_index', sa.BigInteger(), nullable=True), + sa.Column('transaction_type', sa.Integer(), nullable=True), + sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True), + sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False), + sa.PrimaryKeyConstraint('hash', name=op.f('pk_zksync_era_transactions')) + ) + op.create_index(op.f('ix_zksync_era_transactions_block_hash'), 'zksync_era_transactions', ['block_hash'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_block_number'), 'zksync_era_transactions', ['block_number'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_block_timestamp'), 'zksync_era_transactions', ['block_timestamp'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_from_address'), 'zksync_era_transactions', ['from_address'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_gas'), 'zksync_era_transactions', ['gas'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_gas_price'), 'zksync_era_transactions', ['gas_price'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_hash'), 'zksync_era_transactions', ['hash'], unique=True) + op.create_index(op.f('ix_zksync_era_transactions_to_address'), 'zksync_era_transactions', ['to_address'], unique=False) + op.create_index(op.f('ix_zksync_era_transactions_value'), 'zksync_era_transactions', ['value'], unique=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_zksync_era_transactions_value'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_to_address'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_hash'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_gas_price'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_gas'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_from_address'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_block_timestamp'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_block_number'), table_name='zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_transactions_block_hash'), table_name='zksync_era_transactions') + op.drop_table('zksync_era_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_value'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_to_address'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_hash'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_gas_price'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_gas'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_from_address'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_block_timestamp'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_block_number'), table_name='zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_zksync_era_sepolia_transactions_block_hash'), table_name='zksync_era_sepolia_transactions') + op.drop_table('zksync_era_sepolia_transactions') + op.drop_index(op.f('ix_xdai_transactions_value'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_to_address'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_hash'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_gas_price'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_gas'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_from_address'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_block_timestamp'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_block_number'), table_name='xdai_transactions') + op.drop_index(op.f('ix_xdai_transactions_block_hash'), table_name='xdai_transactions') + op.drop_table('xdai_transactions') + op.drop_index(op.f('ix_xai_transactions_value'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_to_address'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_hash'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_gas_price'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_gas'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_from_address'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_block_timestamp'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_block_number'), table_name='xai_transactions') + op.drop_index(op.f('ix_xai_transactions_block_hash'), table_name='xai_transactions') + op.drop_table('xai_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_value'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_to_address'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_hash'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_gas_price'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_gas'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_from_address'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_block_timestamp'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_block_number'), table_name='xai_sepolia_transactions') + op.drop_index(op.f('ix_xai_sepolia_transactions_block_hash'), table_name='xai_sepolia_transactions') + op.drop_table('xai_sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_value'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_to_address'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_hash'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_gas_price'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_gas'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_from_address'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_block_timestamp'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_block_number'), table_name='sepolia_transactions') + op.drop_index(op.f('ix_sepolia_transactions_block_hash'), table_name='sepolia_transactions') + op.drop_table('sepolia_transactions') + op.drop_index(op.f('ix_ronin_transactions_value'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_to_address'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_hash'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_gas_price'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_gas'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_from_address'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_block_timestamp'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_block_number'), table_name='ronin_transactions') + op.drop_index(op.f('ix_ronin_transactions_block_hash'), table_name='ronin_transactions') + op.drop_table('ronin_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_value'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_to_address'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_hash'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_gas_price'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_gas'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_from_address'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_block_timestamp'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_block_number'), table_name='ronin_saigon_transactions') + op.drop_index(op.f('ix_ronin_saigon_transactions_block_hash'), table_name='ronin_saigon_transactions') + op.drop_table('ronin_saigon_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_value'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_to_address'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_hash'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_gas_price'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_gas'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_from_address'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_block_timestamp'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_block_number'), table_name='proofofplay_apex_transactions') + op.drop_index(op.f('ix_proofofplay_apex_transactions_block_hash'), table_name='proofofplay_apex_transactions') + op.drop_table('proofofplay_apex_transactions') + op.drop_index(op.f('ix_polygon_transactions_value'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_to_address'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_hash'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_gas_price'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_gas'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_from_address'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_block_timestamp'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_block_number'), table_name='polygon_transactions') + op.drop_index(op.f('ix_polygon_transactions_block_hash'), table_name='polygon_transactions') + op.drop_table('polygon_transactions') + op.drop_index(op.f('ix_mumbai_transactions_value'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_to_address'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_hash'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_gas_price'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_gas'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_from_address'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_block_timestamp'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_block_number'), table_name='mumbai_transactions') + op.drop_index(op.f('ix_mumbai_transactions_block_hash'), table_name='mumbai_transactions') + op.drop_table('mumbai_transactions') + op.drop_index(op.f('ix_mantle_transactions_value'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_to_address'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_hash'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_gas_price'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_gas'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_from_address'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_block_timestamp'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_block_number'), table_name='mantle_transactions') + op.drop_index(op.f('ix_mantle_transactions_block_hash'), table_name='mantle_transactions') + op.drop_table('mantle_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_value'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_to_address'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_hash'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_gas_price'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_gas'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_from_address'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_block_timestamp'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_block_number'), table_name='mantle_sepolia_transactions') + op.drop_index(op.f('ix_mantle_sepolia_transactions_block_hash'), table_name='mantle_sepolia_transactions') + op.drop_table('mantle_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_value'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_to_address'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_hash'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_gas_price'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_gas'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_from_address'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_block_timestamp'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_block_number'), table_name='imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_transactions_block_hash'), table_name='imx_zkevm_transactions') + op.drop_table('imx_zkevm_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_value'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_to_address'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_hash'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_gas_price'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_gas'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_from_address'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_block_timestamp'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_block_number'), table_name='imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_imx_zkevm_sepolia_transactions_block_hash'), table_name='imx_zkevm_sepolia_transactions') + op.drop_table('imx_zkevm_sepolia_transactions') + op.drop_index(op.f('ix_game7_transactions_value'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_to_address'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_hash'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_gas_price'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_gas'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_from_address'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_block_timestamp'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_block_number'), table_name='game7_transactions') + op.drop_index(op.f('ix_game7_transactions_block_hash'), table_name='game7_transactions') + op.drop_table('game7_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_value'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_to_address'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_hash'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_gas_price'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_gas'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_from_address'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_block_timestamp'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_block_number'), table_name='game7_testnet_transactions') + op.drop_index(op.f('ix_game7_testnet_transactions_block_hash'), table_name='game7_testnet_transactions') + op.drop_table('game7_testnet_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_value'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_to_address'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_hash'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_gas_price'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_gas'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_from_address'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_block_timestamp'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_block_number'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_game7_orbit_arbitrum_sepolia_transactions_block_hash'), table_name='game7_orbit_arbitrum_sepolia_transactions') + op.drop_table('game7_orbit_arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_ethereum_transactions_value'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_to_address'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_hash'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_gas_price'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_gas'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_from_address'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_block_timestamp'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_block_number'), table_name='ethereum_transactions') + op.drop_index(op.f('ix_ethereum_transactions_block_hash'), table_name='ethereum_transactions') + op.drop_table('ethereum_transactions') + op.drop_index(op.f('ix_blast_transactions_value'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_to_address'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_hash'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_gas_price'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_gas'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_from_address'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_block_timestamp'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_block_number'), table_name='blast_transactions') + op.drop_index(op.f('ix_blast_transactions_block_hash'), table_name='blast_transactions') + op.drop_table('blast_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_value'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_to_address'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_hash'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_gas_price'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_gas'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_from_address'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_block_timestamp'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_block_number'), table_name='blast_sepolia_transactions') + op.drop_index(op.f('ix_blast_sepolia_transactions_block_hash'), table_name='blast_sepolia_transactions') + op.drop_table('blast_sepolia_transactions') + op.drop_index(op.f('ix_base_transactions_value'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_to_address'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_hash'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_gas_price'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_gas'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_from_address'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_block_timestamp'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_block_number'), table_name='base_transactions') + op.drop_index(op.f('ix_base_transactions_block_hash'), table_name='base_transactions') + op.drop_table('base_transactions') + op.drop_index(op.f('ix_b3_transactions_value'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_to_address'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_hash'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_gas_price'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_gas'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_from_address'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_block_timestamp'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_block_number'), table_name='b3_transactions') + op.drop_index(op.f('ix_b3_transactions_block_hash'), table_name='b3_transactions') + op.drop_table('b3_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_value'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_to_address'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_hash'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_gas_price'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_gas'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_from_address'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_block_timestamp'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_block_number'), table_name='b3_sepolia_transactions') + op.drop_index(op.f('ix_b3_sepolia_transactions_block_hash'), table_name='b3_sepolia_transactions') + op.drop_table('b3_sepolia_transactions') + op.drop_index(op.f('ix_avalanche_transactions_value'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_to_address'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_hash'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_gas_price'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_gas'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_from_address'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_block_timestamp'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_block_number'), table_name='avalanche_transactions') + op.drop_index(op.f('ix_avalanche_transactions_block_hash'), table_name='avalanche_transactions') + op.drop_table('avalanche_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_value'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_to_address'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_hash'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_gas_price'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_gas'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_from_address'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_block_timestamp'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_block_number'), table_name='avalanche_fuji_transactions') + op.drop_index(op.f('ix_avalanche_fuji_transactions_block_hash'), table_name='avalanche_fuji_transactions') + op.drop_table('avalanche_fuji_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_value'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_to_address'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_hash'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_gas_price'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_gas'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_from_address'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_block_timestamp'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_block_number'), table_name='arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_sepolia_transactions_block_hash'), table_name='arbitrum_sepolia_transactions') + op.drop_table('arbitrum_sepolia_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_value'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_to_address'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_hash'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_gas_price'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_gas'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_from_address'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_block_timestamp'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_block_number'), table_name='arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_one_transactions_block_hash'), table_name='arbitrum_one_transactions') + op.drop_table('arbitrum_one_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_value'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_to_address'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_hash'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_gas_price'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_gas'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_from_address'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_block_timestamp'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_block_number'), table_name='arbitrum_nova_transactions') + op.drop_index(op.f('ix_arbitrum_nova_transactions_block_hash'), table_name='arbitrum_nova_transactions') + op.drop_table('arbitrum_nova_transactions') + op.drop_index(op.f('ix_amoy_transactions_value'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_to_address'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_hash'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_gas_price'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_gas'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_from_address'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_block_timestamp'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_block_number'), table_name='amoy_transactions') + op.drop_index(op.f('ix_amoy_transactions_block_hash'), table_name='amoy_transactions') + op.drop_table('amoy_transactions') + # ### end Alembic commands ### diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py deleted file mode 100644 index 0d92c4135..000000000 --- a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/a6580c96ae2c_add_raw_transactions.py +++ /dev/null @@ -1,2829 +0,0 @@ -"""add raw transactions - -Revision ID: a6580c96ae2c -Revises: e6d3c285e7cc -Create Date: 2024-11-13 11:56:48.605875 - -""" - -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import postgresql - -# revision identifiers, used by Alembic. -revision: str = "a6580c96ae2c" -down_revision: Union[str, None] = "dae735afc98f" -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "amoy_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_amoy_transactions")), - ) - op.create_index( - op.f("ix_amoy_transactions_block_hash"), - "amoy_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_amoy_transactions_block_timestamp"), - "amoy_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_amoy_transactions_from_address"), - "amoy_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_amoy_transactions_gas"), "amoy_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_amoy_transactions_gas_price"), - "amoy_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_amoy_transactions_hash"), "amoy_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_amoy_transactions_to_address"), - "amoy_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_amoy_transactions_value"), "amoy_transactions", ["value"], unique=False - ) - op.create_table( - "arbitrum_nova_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_nova_transactions")), - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_block_hash"), - "arbitrum_nova_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_block_timestamp"), - "arbitrum_nova_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_from_address"), - "arbitrum_nova_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_gas"), - "arbitrum_nova_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_gas_price"), - "arbitrum_nova_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_hash"), - "arbitrum_nova_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_to_address"), - "arbitrum_nova_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_nova_transactions_value"), - "arbitrum_nova_transactions", - ["value"], - unique=False, - ) - op.create_table( - "arbitrum_one_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_one_transactions")), - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_block_hash"), - "arbitrum_one_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_block_timestamp"), - "arbitrum_one_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_from_address"), - "arbitrum_one_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_gas"), - "arbitrum_one_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_gas_price"), - "arbitrum_one_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_hash"), - "arbitrum_one_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_to_address"), - "arbitrum_one_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_one_transactions_value"), - "arbitrum_one_transactions", - ["value"], - unique=False, - ) - op.create_table( - "arbitrum_sepolia_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_sepolia_transactions")), - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_block_hash"), - "arbitrum_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_block_timestamp"), - "arbitrum_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_from_address"), - "arbitrum_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_gas"), - "arbitrum_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_gas_price"), - "arbitrum_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_hash"), - "arbitrum_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_to_address"), - "arbitrum_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_arbitrum_sepolia_transactions_value"), - "arbitrum_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "avalanche_fuji_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_avalanche_fuji_transactions")), - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_block_hash"), - "avalanche_fuji_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_block_timestamp"), - "avalanche_fuji_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_from_address"), - "avalanche_fuji_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_gas"), - "avalanche_fuji_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_gas_price"), - "avalanche_fuji_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_hash"), - "avalanche_fuji_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_to_address"), - "avalanche_fuji_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_fuji_transactions_value"), - "avalanche_fuji_transactions", - ["value"], - unique=False, - ) - op.create_table( - "avalanche_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_avalanche_transactions")), - ) - op.create_index( - op.f("ix_avalanche_transactions_block_hash"), - "avalanche_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_transactions_block_timestamp"), - "avalanche_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_transactions_from_address"), - "avalanche_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_transactions_gas"), - "avalanche_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_transactions_gas_price"), - "avalanche_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_transactions_hash"), - "avalanche_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_avalanche_transactions_to_address"), - "avalanche_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_avalanche_transactions_value"), - "avalanche_transactions", - ["value"], - unique=False, - ) - op.create_table( - "b3_sepolia_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_b3_sepolia_transactions")), - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_block_hash"), - "b3_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_block_timestamp"), - "b3_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_from_address"), - "b3_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_gas"), - "b3_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_gas_price"), - "b3_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_hash"), - "b3_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_to_address"), - "b3_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_b3_sepolia_transactions_value"), - "b3_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "b3_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_b3_transactions")), - ) - op.create_index( - op.f("ix_b3_transactions_block_hash"), - "b3_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_b3_transactions_block_timestamp"), - "b3_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_b3_transactions_from_address"), - "b3_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_b3_transactions_gas"), "b3_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_b3_transactions_gas_price"), - "b3_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_b3_transactions_hash"), "b3_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_b3_transactions_to_address"), - "b3_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_b3_transactions_value"), "b3_transactions", ["value"], unique=False - ) - op.create_table( - "base_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_base_transactions")), - ) - op.create_index( - op.f("ix_base_transactions_block_hash"), - "base_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_base_transactions_block_timestamp"), - "base_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_base_transactions_from_address"), - "base_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_base_transactions_gas"), "base_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_base_transactions_gas_price"), - "base_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_base_transactions_hash"), "base_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_base_transactions_to_address"), - "base_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_base_transactions_value"), "base_transactions", ["value"], unique=False - ) - op.create_table( - "blast_sepolia_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_blast_sepolia_transactions")), - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_block_hash"), - "blast_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_block_timestamp"), - "blast_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_from_address"), - "blast_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_gas"), - "blast_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_gas_price"), - "blast_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_hash"), - "blast_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_to_address"), - "blast_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_blast_sepolia_transactions_value"), - "blast_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "blast_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_blast_transactions")), - ) - op.create_index( - op.f("ix_blast_transactions_block_hash"), - "blast_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_blast_transactions_block_timestamp"), - "blast_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_blast_transactions_from_address"), - "blast_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_blast_transactions_gas"), "blast_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_blast_transactions_gas_price"), - "blast_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_blast_transactions_hash"), "blast_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_blast_transactions_to_address"), - "blast_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_blast_transactions_value"), - "blast_transactions", - ["value"], - unique=False, - ) - op.create_table( - "ethereum_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_ethereum_transactions")), - ) - op.create_index( - op.f("ix_ethereum_transactions_block_hash"), - "ethereum_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_ethereum_transactions_block_timestamp"), - "ethereum_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_ethereum_transactions_from_address"), - "ethereum_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_ethereum_transactions_gas"), - "ethereum_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_ethereum_transactions_gas_price"), - "ethereum_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_ethereum_transactions_hash"), - "ethereum_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_ethereum_transactions_to_address"), - "ethereum_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_ethereum_transactions_value"), - "ethereum_transactions", - ["value"], - unique=False, - ) - op.create_table( - "game7_orbit_arbitrum_sepolia_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint( - "hash", name=op.f("pk_game7_orbit_arbitrum_sepolia_transactions") - ), - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_hash"), - "game7_orbit_arbitrum_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_timestamp"), - "game7_orbit_arbitrum_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_from_address"), - "game7_orbit_arbitrum_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas"), - "game7_orbit_arbitrum_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas_price"), - "game7_orbit_arbitrum_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_hash"), - "game7_orbit_arbitrum_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_to_address"), - "game7_orbit_arbitrum_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_value"), - "game7_orbit_arbitrum_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "game7_testnet_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_game7_testnet_transactions")), - ) - op.create_index( - op.f("ix_game7_testnet_transactions_block_hash"), - "game7_testnet_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_block_timestamp"), - "game7_testnet_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_from_address"), - "game7_testnet_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_gas"), - "game7_testnet_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_gas_price"), - "game7_testnet_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_hash"), - "game7_testnet_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_to_address"), - "game7_testnet_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_game7_testnet_transactions_value"), - "game7_testnet_transactions", - ["value"], - unique=False, - ) - op.create_table( - "game7_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_game7_transactions")), - ) - op.create_index( - op.f("ix_game7_transactions_block_hash"), - "game7_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_game7_transactions_block_timestamp"), - "game7_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_game7_transactions_from_address"), - "game7_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_game7_transactions_gas"), "game7_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_game7_transactions_gas_price"), - "game7_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_game7_transactions_hash"), "game7_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_game7_transactions_to_address"), - "game7_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_game7_transactions_value"), - "game7_transactions", - ["value"], - unique=False, - ) - op.create_table( - "imx_zkevm_sepolia_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_imx_zkevm_sepolia_transactions")), - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_block_hash"), - "imx_zkevm_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_block_timestamp"), - "imx_zkevm_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_from_address"), - "imx_zkevm_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_gas"), - "imx_zkevm_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_gas_price"), - "imx_zkevm_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_hash"), - "imx_zkevm_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_to_address"), - "imx_zkevm_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_sepolia_transactions_value"), - "imx_zkevm_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "imx_zkevm_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_imx_zkevm_transactions")), - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_block_hash"), - "imx_zkevm_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_block_timestamp"), - "imx_zkevm_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_from_address"), - "imx_zkevm_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_gas"), - "imx_zkevm_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_gas_price"), - "imx_zkevm_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_hash"), - "imx_zkevm_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_to_address"), - "imx_zkevm_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_imx_zkevm_transactions_value"), - "imx_zkevm_transactions", - ["value"], - unique=False, - ) - op.create_table( - "mantle_sepolia_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_mantle_sepolia_transactions")), - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_block_hash"), - "mantle_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_block_timestamp"), - "mantle_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_from_address"), - "mantle_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_gas"), - "mantle_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_gas_price"), - "mantle_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_hash"), - "mantle_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_to_address"), - "mantle_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_sepolia_transactions_value"), - "mantle_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "mantle_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_mantle_transactions")), - ) - op.create_index( - op.f("ix_mantle_transactions_block_hash"), - "mantle_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_transactions_block_timestamp"), - "mantle_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_transactions_from_address"), - "mantle_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_transactions_gas"), "mantle_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_mantle_transactions_gas_price"), - "mantle_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_transactions_hash"), - "mantle_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_mantle_transactions_to_address"), - "mantle_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_mantle_transactions_value"), - "mantle_transactions", - ["value"], - unique=False, - ) - op.create_table( - "mumbai_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_mumbai_transactions")), - ) - op.create_index( - op.f("ix_mumbai_transactions_block_hash"), - "mumbai_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_mumbai_transactions_block_timestamp"), - "mumbai_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_mumbai_transactions_from_address"), - "mumbai_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_mumbai_transactions_gas"), "mumbai_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_mumbai_transactions_gas_price"), - "mumbai_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_mumbai_transactions_hash"), - "mumbai_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_mumbai_transactions_to_address"), - "mumbai_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_mumbai_transactions_value"), - "mumbai_transactions", - ["value"], - unique=False, - ) - op.create_table( - "polygon_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_polygon_transactions")), - ) - op.create_index( - op.f("ix_polygon_transactions_block_hash"), - "polygon_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_polygon_transactions_block_timestamp"), - "polygon_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_polygon_transactions_from_address"), - "polygon_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_polygon_transactions_gas"), - "polygon_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_polygon_transactions_gas_price"), - "polygon_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_polygon_transactions_hash"), - "polygon_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_polygon_transactions_to_address"), - "polygon_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_polygon_transactions_value"), - "polygon_transactions", - ["value"], - unique=False, - ) - op.create_table( - "proofofplay_apex_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_proofofplay_apex_transactions")), - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_block_hash"), - "proofofplay_apex_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_block_timestamp"), - "proofofplay_apex_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_from_address"), - "proofofplay_apex_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_gas"), - "proofofplay_apex_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_gas_price"), - "proofofplay_apex_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_hash"), - "proofofplay_apex_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_to_address"), - "proofofplay_apex_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_proofofplay_apex_transactions_value"), - "proofofplay_apex_transactions", - ["value"], - unique=False, - ) - op.create_table( - "ronin_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_ronin_transactions")), - ) - op.create_index( - op.f("ix_ronin_transactions_block_hash"), - "ronin_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_ronin_transactions_block_timestamp"), - "ronin_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_ronin_transactions_from_address"), - "ronin_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_ronin_transactions_gas"), "ronin_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_ronin_transactions_gas_price"), - "ronin_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_ronin_transactions_hash"), "ronin_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_ronin_transactions_to_address"), - "ronin_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_ronin_transactions_value"), - "ronin_transactions", - ["value"], - unique=False, - ) - op.create_table( - "sepolia_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_sepolia_transactions")), - ) - op.create_index( - op.f("ix_sepolia_transactions_block_hash"), - "sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_sepolia_transactions_block_timestamp"), - "sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_sepolia_transactions_from_address"), - "sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_sepolia_transactions_gas"), - "sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_sepolia_transactions_gas_price"), - "sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_sepolia_transactions_hash"), - "sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_sepolia_transactions_to_address"), - "sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_sepolia_transactions_value"), - "sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "xai_sepolia_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_xai_sepolia_transactions")), - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_block_hash"), - "xai_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_block_timestamp"), - "xai_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_from_address"), - "xai_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_gas"), - "xai_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_gas_price"), - "xai_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_hash"), - "xai_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_to_address"), - "xai_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_xai_sepolia_transactions_value"), - "xai_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "xai_transactions", - sa.Column("l1_block_number", sa.BigInteger(), nullable=True), - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_xai_transactions")), - ) - op.create_index( - op.f("ix_xai_transactions_block_hash"), - "xai_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_xai_transactions_block_timestamp"), - "xai_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_xai_transactions_from_address"), - "xai_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_xai_transactions_gas"), "xai_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_xai_transactions_gas_price"), - "xai_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_xai_transactions_hash"), "xai_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_xai_transactions_to_address"), - "xai_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_xai_transactions_value"), "xai_transactions", ["value"], unique=False - ) - op.create_table( - "xdai_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_xdai_transactions")), - ) - op.create_index( - op.f("ix_xdai_transactions_block_hash"), - "xdai_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_xdai_transactions_block_timestamp"), - "xdai_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_xdai_transactions_from_address"), - "xdai_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_xdai_transactions_gas"), "xdai_transactions", ["gas"], unique=False - ) - op.create_index( - op.f("ix_xdai_transactions_gas_price"), - "xdai_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_xdai_transactions_hash"), "xdai_transactions", ["hash"], unique=True - ) - op.create_index( - op.f("ix_xdai_transactions_to_address"), - "xdai_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_xdai_transactions_value"), "xdai_transactions", ["value"], unique=False - ) - op.create_table( - "zksync_era_sepolia_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint( - "hash", name=op.f("pk_zksync_era_sepolia_transactions") - ), - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_block_hash"), - "zksync_era_sepolia_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_block_timestamp"), - "zksync_era_sepolia_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_from_address"), - "zksync_era_sepolia_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_gas"), - "zksync_era_sepolia_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_gas_price"), - "zksync_era_sepolia_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_hash"), - "zksync_era_sepolia_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_to_address"), - "zksync_era_sepolia_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_sepolia_transactions_value"), - "zksync_era_sepolia_transactions", - ["value"], - unique=False, - ) - op.create_table( - "zksync_era_transactions", - sa.Column("hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("block_timestamp", sa.BigInteger(), nullable=False), - sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False), - sa.Column("from_address", sa.LargeBinary(), nullable=True), - sa.Column("to_address", sa.LargeBinary(), nullable=True), - sa.Column("gas", sa.BigInteger(), nullable=True), - sa.Column("gas_price", sa.BigInteger(), nullable=True), - sa.Column("max_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("max_priority_fee_per_gas", sa.BigInteger(), nullable=True), - sa.Column("input", sa.Text(), nullable=True), - sa.Column("nonce", sa.BigInteger(), nullable=True), - sa.Column("transaction_index", sa.BigInteger(), nullable=True), - sa.Column("transaction_type", sa.Integer(), nullable=True), - sa.Column("value", sa.BigInteger(), nullable=True), - sa.Column( - "indexed_at", - sa.DateTime(timezone=True), - server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), - nullable=False, - ), - sa.PrimaryKeyConstraint("hash", name=op.f("pk_zksync_era_transactions")), - ) - op.create_index( - op.f("ix_zksync_era_transactions_block_hash"), - "zksync_era_transactions", - ["block_hash"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_transactions_block_timestamp"), - "zksync_era_transactions", - ["block_timestamp"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_transactions_from_address"), - "zksync_era_transactions", - ["from_address"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_transactions_gas"), - "zksync_era_transactions", - ["gas"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_transactions_gas_price"), - "zksync_era_transactions", - ["gas_price"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_transactions_hash"), - "zksync_era_transactions", - ["hash"], - unique=True, - ) - op.create_index( - op.f("ix_zksync_era_transactions_to_address"), - "zksync_era_transactions", - ["to_address"], - unique=False, - ) - op.create_index( - op.f("ix_zksync_era_transactions_value"), - "zksync_era_transactions", - ["value"], - unique=False, - ) - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_index( - op.f("ix_zksync_era_transactions_value"), table_name="zksync_era_transactions" - ) - op.drop_index( - op.f("ix_zksync_era_transactions_to_address"), - table_name="zksync_era_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_transactions_hash"), table_name="zksync_era_transactions" - ) - op.drop_index( - op.f("ix_zksync_era_transactions_gas_price"), - table_name="zksync_era_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_transactions_gas"), table_name="zksync_era_transactions" - ) - op.drop_index( - op.f("ix_zksync_era_transactions_from_address"), - table_name="zksync_era_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_transactions_block_timestamp"), - table_name="zksync_era_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_transactions_block_hash"), - table_name="zksync_era_transactions", - ) - op.drop_table("zksync_era_transactions") - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_value"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_to_address"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_hash"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_gas_price"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_gas"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_from_address"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_block_timestamp"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_index( - op.f("ix_zksync_era_sepolia_transactions_block_hash"), - table_name="zksync_era_sepolia_transactions", - ) - op.drop_table("zksync_era_sepolia_transactions") - op.drop_index(op.f("ix_xdai_transactions_value"), table_name="xdai_transactions") - op.drop_index( - op.f("ix_xdai_transactions_to_address"), table_name="xdai_transactions" - ) - op.drop_index(op.f("ix_xdai_transactions_hash"), table_name="xdai_transactions") - op.drop_index( - op.f("ix_xdai_transactions_gas_price"), table_name="xdai_transactions" - ) - op.drop_index(op.f("ix_xdai_transactions_gas"), table_name="xdai_transactions") - op.drop_index( - op.f("ix_xdai_transactions_from_address"), table_name="xdai_transactions" - ) - op.drop_index( - op.f("ix_xdai_transactions_block_timestamp"), table_name="xdai_transactions" - ) - op.drop_index( - op.f("ix_xdai_transactions_block_hash"), table_name="xdai_transactions" - ) - op.drop_table("xdai_transactions") - op.drop_index(op.f("ix_xai_transactions_value"), table_name="xai_transactions") - op.drop_index(op.f("ix_xai_transactions_to_address"), table_name="xai_transactions") - op.drop_index(op.f("ix_xai_transactions_hash"), table_name="xai_transactions") - op.drop_index(op.f("ix_xai_transactions_gas_price"), table_name="xai_transactions") - op.drop_index(op.f("ix_xai_transactions_gas"), table_name="xai_transactions") - op.drop_index( - op.f("ix_xai_transactions_from_address"), table_name="xai_transactions" - ) - op.drop_index( - op.f("ix_xai_transactions_block_timestamp"), table_name="xai_transactions" - ) - op.drop_index(op.f("ix_xai_transactions_block_hash"), table_name="xai_transactions") - op.drop_table("xai_transactions") - op.drop_index( - op.f("ix_xai_sepolia_transactions_value"), table_name="xai_sepolia_transactions" - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_to_address"), - table_name="xai_sepolia_transactions", - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_hash"), table_name="xai_sepolia_transactions" - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_gas_price"), - table_name="xai_sepolia_transactions", - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_gas"), table_name="xai_sepolia_transactions" - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_from_address"), - table_name="xai_sepolia_transactions", - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_block_timestamp"), - table_name="xai_sepolia_transactions", - ) - op.drop_index( - op.f("ix_xai_sepolia_transactions_block_hash"), - table_name="xai_sepolia_transactions", - ) - op.drop_table("xai_sepolia_transactions") - op.drop_index( - op.f("ix_sepolia_transactions_value"), table_name="sepolia_transactions" - ) - op.drop_index( - op.f("ix_sepolia_transactions_to_address"), table_name="sepolia_transactions" - ) - op.drop_index( - op.f("ix_sepolia_transactions_hash"), table_name="sepolia_transactions" - ) - op.drop_index( - op.f("ix_sepolia_transactions_gas_price"), table_name="sepolia_transactions" - ) - op.drop_index( - op.f("ix_sepolia_transactions_gas"), table_name="sepolia_transactions" - ) - op.drop_index( - op.f("ix_sepolia_transactions_from_address"), table_name="sepolia_transactions" - ) - op.drop_index( - op.f("ix_sepolia_transactions_block_timestamp"), - table_name="sepolia_transactions", - ) - op.drop_index( - op.f("ix_sepolia_transactions_block_hash"), table_name="sepolia_transactions" - ) - op.drop_table("sepolia_transactions") - op.drop_index(op.f("ix_ronin_transactions_value"), table_name="ronin_transactions") - op.drop_index( - op.f("ix_ronin_transactions_to_address"), table_name="ronin_transactions" - ) - op.drop_index(op.f("ix_ronin_transactions_hash"), table_name="ronin_transactions") - op.drop_index( - op.f("ix_ronin_transactions_gas_price"), table_name="ronin_transactions" - ) - op.drop_index(op.f("ix_ronin_transactions_gas"), table_name="ronin_transactions") - op.drop_index( - op.f("ix_ronin_transactions_from_address"), table_name="ronin_transactions" - ) - op.drop_index( - op.f("ix_ronin_transactions_block_timestamp"), table_name="ronin_transactions" - ) - op.drop_index( - op.f("ix_ronin_transactions_block_hash"), table_name="ronin_transactions" - ) - op.drop_table("ronin_transactions") - op.drop_index( - op.f("ix_proofofplay_apex_transactions_value"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_to_address"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_hash"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_gas_price"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_gas"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_from_address"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_block_timestamp"), - table_name="proofofplay_apex_transactions", - ) - op.drop_index( - op.f("ix_proofofplay_apex_transactions_block_hash"), - table_name="proofofplay_apex_transactions", - ) - op.drop_table("proofofplay_apex_transactions") - op.drop_index( - op.f("ix_polygon_transactions_value"), table_name="polygon_transactions" - ) - op.drop_index( - op.f("ix_polygon_transactions_to_address"), table_name="polygon_transactions" - ) - op.drop_index( - op.f("ix_polygon_transactions_hash"), table_name="polygon_transactions" - ) - op.drop_index( - op.f("ix_polygon_transactions_gas_price"), table_name="polygon_transactions" - ) - op.drop_index( - op.f("ix_polygon_transactions_gas"), table_name="polygon_transactions" - ) - op.drop_index( - op.f("ix_polygon_transactions_from_address"), table_name="polygon_transactions" - ) - op.drop_index( - op.f("ix_polygon_transactions_block_timestamp"), - table_name="polygon_transactions", - ) - op.drop_index( - op.f("ix_polygon_transactions_block_hash"), table_name="polygon_transactions" - ) - op.drop_table("polygon_transactions") - op.drop_index( - op.f("ix_mumbai_transactions_value"), table_name="mumbai_transactions" - ) - op.drop_index( - op.f("ix_mumbai_transactions_to_address"), table_name="mumbai_transactions" - ) - op.drop_index(op.f("ix_mumbai_transactions_hash"), table_name="mumbai_transactions") - op.drop_index( - op.f("ix_mumbai_transactions_gas_price"), table_name="mumbai_transactions" - ) - op.drop_index(op.f("ix_mumbai_transactions_gas"), table_name="mumbai_transactions") - op.drop_index( - op.f("ix_mumbai_transactions_from_address"), table_name="mumbai_transactions" - ) - op.drop_index( - op.f("ix_mumbai_transactions_block_timestamp"), table_name="mumbai_transactions" - ) - op.drop_index( - op.f("ix_mumbai_transactions_block_hash"), table_name="mumbai_transactions" - ) - op.drop_table("mumbai_transactions") - op.drop_index( - op.f("ix_mantle_transactions_value"), table_name="mantle_transactions" - ) - op.drop_index( - op.f("ix_mantle_transactions_to_address"), table_name="mantle_transactions" - ) - op.drop_index(op.f("ix_mantle_transactions_hash"), table_name="mantle_transactions") - op.drop_index( - op.f("ix_mantle_transactions_gas_price"), table_name="mantle_transactions" - ) - op.drop_index(op.f("ix_mantle_transactions_gas"), table_name="mantle_transactions") - op.drop_index( - op.f("ix_mantle_transactions_from_address"), table_name="mantle_transactions" - ) - op.drop_index( - op.f("ix_mantle_transactions_block_timestamp"), table_name="mantle_transactions" - ) - op.drop_index( - op.f("ix_mantle_transactions_block_hash"), table_name="mantle_transactions" - ) - op.drop_table("mantle_transactions") - op.drop_index( - op.f("ix_mantle_sepolia_transactions_value"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_to_address"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_hash"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_gas_price"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_gas"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_from_address"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_block_timestamp"), - table_name="mantle_sepolia_transactions", - ) - op.drop_index( - op.f("ix_mantle_sepolia_transactions_block_hash"), - table_name="mantle_sepolia_transactions", - ) - op.drop_table("mantle_sepolia_transactions") - op.drop_index( - op.f("ix_imx_zkevm_transactions_value"), table_name="imx_zkevm_transactions" - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_to_address"), - table_name="imx_zkevm_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_hash"), table_name="imx_zkevm_transactions" - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_gas_price"), table_name="imx_zkevm_transactions" - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_gas"), table_name="imx_zkevm_transactions" - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_from_address"), - table_name="imx_zkevm_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_block_timestamp"), - table_name="imx_zkevm_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_transactions_block_hash"), - table_name="imx_zkevm_transactions", - ) - op.drop_table("imx_zkevm_transactions") - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_value"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_to_address"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_hash"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_gas_price"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_gas"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_from_address"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_block_timestamp"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_index( - op.f("ix_imx_zkevm_sepolia_transactions_block_hash"), - table_name="imx_zkevm_sepolia_transactions", - ) - op.drop_table("imx_zkevm_sepolia_transactions") - op.drop_index(op.f("ix_game7_transactions_value"), table_name="game7_transactions") - op.drop_index( - op.f("ix_game7_transactions_to_address"), table_name="game7_transactions" - ) - op.drop_index(op.f("ix_game7_transactions_hash"), table_name="game7_transactions") - op.drop_index( - op.f("ix_game7_transactions_gas_price"), table_name="game7_transactions" - ) - op.drop_index(op.f("ix_game7_transactions_gas"), table_name="game7_transactions") - op.drop_index( - op.f("ix_game7_transactions_from_address"), table_name="game7_transactions" - ) - op.drop_index( - op.f("ix_game7_transactions_block_timestamp"), table_name="game7_transactions" - ) - op.drop_index( - op.f("ix_game7_transactions_block_hash"), table_name="game7_transactions" - ) - op.drop_table("game7_transactions") - op.drop_index( - op.f("ix_game7_testnet_transactions_value"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_to_address"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_hash"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_gas_price"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_gas"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_from_address"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_block_timestamp"), - table_name="game7_testnet_transactions", - ) - op.drop_index( - op.f("ix_game7_testnet_transactions_block_hash"), - table_name="game7_testnet_transactions", - ) - op.drop_table("game7_testnet_transactions") - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_value"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_to_address"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_hash"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas_price"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_gas"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_from_address"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_timestamp"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_game7_orbit_arbitrum_sepolia_transactions_block_hash"), - table_name="game7_orbit_arbitrum_sepolia_transactions", - ) - op.drop_table("game7_orbit_arbitrum_sepolia_transactions") - op.drop_index( - op.f("ix_ethereum_transactions_value"), table_name="ethereum_transactions" - ) - op.drop_index( - op.f("ix_ethereum_transactions_to_address"), table_name="ethereum_transactions" - ) - op.drop_index( - op.f("ix_ethereum_transactions_hash"), table_name="ethereum_transactions" - ) - op.drop_index( - op.f("ix_ethereum_transactions_gas_price"), table_name="ethereum_transactions" - ) - op.drop_index( - op.f("ix_ethereum_transactions_gas"), table_name="ethereum_transactions" - ) - op.drop_index( - op.f("ix_ethereum_transactions_from_address"), - table_name="ethereum_transactions", - ) - op.drop_index( - op.f("ix_ethereum_transactions_block_timestamp"), - table_name="ethereum_transactions", - ) - op.drop_index( - op.f("ix_ethereum_transactions_block_hash"), table_name="ethereum_transactions" - ) - op.drop_table("ethereum_transactions") - op.drop_index(op.f("ix_blast_transactions_value"), table_name="blast_transactions") - op.drop_index( - op.f("ix_blast_transactions_to_address"), table_name="blast_transactions" - ) - op.drop_index(op.f("ix_blast_transactions_hash"), table_name="blast_transactions") - op.drop_index( - op.f("ix_blast_transactions_gas_price"), table_name="blast_transactions" - ) - op.drop_index(op.f("ix_blast_transactions_gas"), table_name="blast_transactions") - op.drop_index( - op.f("ix_blast_transactions_from_address"), table_name="blast_transactions" - ) - op.drop_index( - op.f("ix_blast_transactions_block_timestamp"), table_name="blast_transactions" - ) - op.drop_index( - op.f("ix_blast_transactions_block_hash"), table_name="blast_transactions" - ) - op.drop_table("blast_transactions") - op.drop_index( - op.f("ix_blast_sepolia_transactions_value"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_to_address"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_hash"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_gas_price"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_gas"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_from_address"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_block_timestamp"), - table_name="blast_sepolia_transactions", - ) - op.drop_index( - op.f("ix_blast_sepolia_transactions_block_hash"), - table_name="blast_sepolia_transactions", - ) - op.drop_table("blast_sepolia_transactions") - op.drop_index(op.f("ix_base_transactions_value"), table_name="base_transactions") - op.drop_index( - op.f("ix_base_transactions_to_address"), table_name="base_transactions" - ) - op.drop_index(op.f("ix_base_transactions_hash"), table_name="base_transactions") - op.drop_index( - op.f("ix_base_transactions_gas_price"), table_name="base_transactions" - ) - op.drop_index(op.f("ix_base_transactions_gas"), table_name="base_transactions") - op.drop_index( - op.f("ix_base_transactions_from_address"), table_name="base_transactions" - ) - op.drop_index( - op.f("ix_base_transactions_block_timestamp"), table_name="base_transactions" - ) - op.drop_index( - op.f("ix_base_transactions_block_hash"), table_name="base_transactions" - ) - op.drop_table("base_transactions") - op.drop_index(op.f("ix_b3_transactions_value"), table_name="b3_transactions") - op.drop_index(op.f("ix_b3_transactions_to_address"), table_name="b3_transactions") - op.drop_index(op.f("ix_b3_transactions_hash"), table_name="b3_transactions") - op.drop_index(op.f("ix_b3_transactions_gas_price"), table_name="b3_transactions") - op.drop_index(op.f("ix_b3_transactions_gas"), table_name="b3_transactions") - op.drop_index(op.f("ix_b3_transactions_from_address"), table_name="b3_transactions") - op.drop_index( - op.f("ix_b3_transactions_block_timestamp"), table_name="b3_transactions" - ) - op.drop_index(op.f("ix_b3_transactions_block_hash"), table_name="b3_transactions") - op.drop_table("b3_transactions") - op.drop_index( - op.f("ix_b3_sepolia_transactions_value"), table_name="b3_sepolia_transactions" - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_to_address"), - table_name="b3_sepolia_transactions", - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_hash"), table_name="b3_sepolia_transactions" - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_gas_price"), - table_name="b3_sepolia_transactions", - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_gas"), table_name="b3_sepolia_transactions" - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_from_address"), - table_name="b3_sepolia_transactions", - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_block_timestamp"), - table_name="b3_sepolia_transactions", - ) - op.drop_index( - op.f("ix_b3_sepolia_transactions_block_hash"), - table_name="b3_sepolia_transactions", - ) - op.drop_table("b3_sepolia_transactions") - op.drop_index( - op.f("ix_avalanche_transactions_value"), table_name="avalanche_transactions" - ) - op.drop_index( - op.f("ix_avalanche_transactions_to_address"), - table_name="avalanche_transactions", - ) - op.drop_index( - op.f("ix_avalanche_transactions_hash"), table_name="avalanche_transactions" - ) - op.drop_index( - op.f("ix_avalanche_transactions_gas_price"), table_name="avalanche_transactions" - ) - op.drop_index( - op.f("ix_avalanche_transactions_gas"), table_name="avalanche_transactions" - ) - op.drop_index( - op.f("ix_avalanche_transactions_from_address"), - table_name="avalanche_transactions", - ) - op.drop_index( - op.f("ix_avalanche_transactions_block_timestamp"), - table_name="avalanche_transactions", - ) - op.drop_index( - op.f("ix_avalanche_transactions_block_hash"), - table_name="avalanche_transactions", - ) - op.drop_table("avalanche_transactions") - op.drop_index( - op.f("ix_avalanche_fuji_transactions_value"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_to_address"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_hash"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_gas_price"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_gas"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_from_address"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_block_timestamp"), - table_name="avalanche_fuji_transactions", - ) - op.drop_index( - op.f("ix_avalanche_fuji_transactions_block_hash"), - table_name="avalanche_fuji_transactions", - ) - op.drop_table("avalanche_fuji_transactions") - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_value"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_to_address"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_hash"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_gas_price"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_gas"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_from_address"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_block_timestamp"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_sepolia_transactions_block_hash"), - table_name="arbitrum_sepolia_transactions", - ) - op.drop_table("arbitrum_sepolia_transactions") - op.drop_index( - op.f("ix_arbitrum_one_transactions_value"), - table_name="arbitrum_one_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_to_address"), - table_name="arbitrum_one_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_hash"), - table_name="arbitrum_one_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_gas_price"), - table_name="arbitrum_one_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_gas"), table_name="arbitrum_one_transactions" - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_from_address"), - table_name="arbitrum_one_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_block_timestamp"), - table_name="arbitrum_one_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_one_transactions_block_hash"), - table_name="arbitrum_one_transactions", - ) - op.drop_table("arbitrum_one_transactions") - op.drop_index( - op.f("ix_arbitrum_nova_transactions_value"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_to_address"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_hash"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_gas_price"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_gas"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_from_address"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_block_timestamp"), - table_name="arbitrum_nova_transactions", - ) - op.drop_index( - op.f("ix_arbitrum_nova_transactions_block_hash"), - table_name="arbitrum_nova_transactions", - ) - op.drop_table("arbitrum_nova_transactions") - op.drop_index(op.f("ix_amoy_transactions_value"), table_name="amoy_transactions") - op.drop_index( - op.f("ix_amoy_transactions_to_address"), table_name="amoy_transactions" - ) - op.drop_index(op.f("ix_amoy_transactions_hash"), table_name="amoy_transactions") - op.drop_index( - op.f("ix_amoy_transactions_gas_price"), table_name="amoy_transactions" - ) - op.drop_index(op.f("ix_amoy_transactions_gas"), table_name="amoy_transactions") - op.drop_index( - op.f("ix_amoy_transactions_from_address"), table_name="amoy_transactions" - ) - op.drop_index( - op.f("ix_amoy_transactions_block_timestamp"), table_name="amoy_transactions" - ) - op.drop_index( - op.f("ix_amoy_transactions_block_hash"), table_name="amoy_transactions" - ) - op.drop_table("amoy_transactions") - # ### end Alembic commands ### diff --git a/moonstreamdb-v3/moonstreamdbv3/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index 94f8166b0..42339a364 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -125,48 +125,17 @@ class EvmBasedLabel(Base): # type: ignore ) -# class EthereumTransaction(Base): # type: ignore -# __tablename__ = "ethereum_transactions" - -# hash = Column( -# VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True -# ) -# block_number = Column( -# BigInteger, -# ForeignKey("ethereum_blocks.block_number", ondelete="CASCADE"), -# nullable=False, -# index=True, -# ) -# from_address = Column(VARCHAR(256), index=True) -# to_address = Column(VARCHAR(256), index=True) -# gas = Column(Numeric(precision=78, scale=0), index=True) -# gas_price = Column(Numeric(precision=78, scale=0), index=True) -# max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True) -# max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True) -# 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( -# DateTime(timezone=True), server_default=utcnow(), nullable=False -# ) - - class EvmBasedTransaction(Base): # type: ignore __abstract__ = True hash = Column( VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True ) - block_number = ( - Column( + block_number = Column( BigInteger, nullable=False, index=True, - ), - ) + ) block_timestamp = Column(BigInteger, nullable=False, index=True) block_hash = Column(VARCHAR(256), nullable=False, index=True) from_address = Column(LargeBinary, index=True) @@ -1711,6 +1680,10 @@ class RoninLabel(EvmBasedLabel): # type: ignore ) +class RoninTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "ronin_transactions" + + class RoninSaigonLabel(EvmBasedLabel): # type: ignore __tablename__ = "ronin_saigon_labels" @@ -1756,5 +1729,5 @@ class RoninSaigonLabel(EvmBasedLabel): # type: ignore ) -class RoninTransaction(EvmBasedTransaction): # type: ignore - __tablename__ = "ronin_transactions" +class RoninSaigonTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "ronin_saigon_transactions"