diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/env.py b/moonstreamdb-v3/moonstreamdbv3/alembic/env.py index 62dcb91b..2bd417fb 100644 --- a/moonstreamdb-v3/moonstreamdbv3/alembic/env.py +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/env.py @@ -27,72 +27,128 @@ target_metadata = MoonstreamBase.metadata 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, RoninLabel, RoninSaigonLabel, 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__, RoninLabel.__tablename__, RoninSaigonLabel.__tablename__, } diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/bebe640146b6_add_raw_transactions.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/bebe640146b6_add_raw_transactions.py new file mode 100644 index 00000000..10556a94 --- /dev/null +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/bebe640146b6_add_raw_transactions.py @@ -0,0 +1,1177 @@ +"""Add raw transactions + +Revision ID: bebe640146b6 +Revises: c79044e047fe +Create Date: 2025-03-04 00:34:20.551263 + +""" +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 = 'bebe640146b6' +down_revision: Union[str, None] = 'c79044e047fe' +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/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index d60a1d35..e1c2d41e 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -27,6 +27,7 @@ from sqlalchemy import ( Integer, LargeBinary, MetaData, + Numeric, Text, ) from sqlalchemy.dialects.postgresql import JSONB, UUID @@ -160,6 +161,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(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 + ) + + +## Labels + class EthereumLabel(EvmBasedLabel): # type: ignore __tablename__ = "ethereum_labels" @@ -256,3 +289,138 @@ class RoninLabel(EvmBasedLabel): # type: ignore class RoninSaigonLabel(EvmBasedLabel): # type: ignore __tablename__ = "ronin_saigon_labels" + + + + +## Transactions + +class EthereumTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "ethereum_transactions" + + +class SepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "sepolia_transactions" + + +class PolygonTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "polygon_transactions" + + +class MumbaiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "mumbai_transactions" + + +class AmoyTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "amoy_transactions" + + +class XDaiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "xdai_transactions" + + +class ZkSyncEraTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "zksync_era_transactions" + + +class ZkSyncEraSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "zksync_era_sepolia_transactions" + + +class BaseTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "base_transactions" + + +class ArbitrumNovaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "arbitrum_nova_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + +class ArbitrumOneTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "arbitrum_one_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + +class ArbitrumSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "arbitrum_sepolia_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + +class Game7OrbitArbitrumSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "game7_orbit_arbitrum_sepolia_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + +class XaiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "xai_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + +class XaiSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "xai_sepolia_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + +class AvalancheTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "avalanche_transactions" + +class AvalancheFujiTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "avalanche_fuji_transactions" + +class BlastTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "blast_transactions" + +class BlastSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "blast_sepolia_transactions" + + +class ProofOfPlayApexTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "proofofplay_apex_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + +class MantleTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "mantle_transactions" + + +class MantleSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "mantle_sepolia_transactions" + + +class ImxZkevmTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "imx_zkevm_transactions" + + +class ImxZkevmSepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "imx_zkevm_sepolia_transactions" + + +class Game7Transaction(EvmBasedTransaction): # type: ignore + __tablename__ = "game7_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + + +class Game7TestnetTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "game7_testnet_transactions" + + l1_block_number = Column(BigInteger, nullable=True) + + +class B3Transaction(EvmBasedTransaction): # type: ignore + __tablename__ = "b3_transactions" + + + +class B3SepoliaTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "b3_sepolia_transactions" + + +class RoninTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "ronin_transactions" + + +class RoninSaigonTransaction(EvmBasedTransaction): # type: ignore + __tablename__ = "ronin_saigon_transactions" diff --git a/moonstreamdb-v3/moonstreamdbv3/version.txt b/moonstreamdb-v3/moonstreamdbv3/version.txt index def9a015..c946ee61 100644 --- a/moonstreamdb-v3/moonstreamdbv3/version.txt +++ b/moonstreamdb-v3/moonstreamdbv3/version.txt @@ -1 +1 @@ -0.1.5 \ No newline at end of file +0.1.6