From e700a146fd421dfdc9423dec3924899beae8408e Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 24 Jul 2024 15:04:14 +0300 Subject: [PATCH 1/2] Add unique indexes. --- .../versions/090c247f8618_seer_raw_index.py | 605 ++++++++++++++++++ 1 file changed, 605 insertions(+) create mode 100644 moonstreamdb-v3/moonstreamdbv3/alembic/versions/090c247f8618_seer_raw_index.py diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/090c247f8618_seer_raw_index.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/090c247f8618_seer_raw_index.py new file mode 100644 index 00000000..4a64d7c0 --- /dev/null +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/090c247f8618_seer_raw_index.py @@ -0,0 +1,605 @@ +"""seer raw index + +Revision ID: 090c247f8618 +Revises: 2e90b758090c +Create Date: 2024-07-24 14:55:15.986453 + +""" + +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 = "090c247f8618" +down_revision: Union[str, None] = "2e90b758090c" +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_index( + "uk_amoy_labels_tx_hash_log_idx_evt_raw", + "amoy_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_amoy_labels_tx_hash_tx_call_raw", + "amoy_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_arbitrum_nova_labels_tx_hash_log_idx_evt_raw", + "arbitrum_nova_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_arbitrum_nova_labels_tx_hash_tx_call_raw", + "arbitrum_nova_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_arbitrum_one_labels_tx_hash_log_idx_evt_raw", + "arbitrum_one_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_arbitrum_one_labels_tx_hash_tx_call_raw", + "arbitrum_one_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", + "arbitrum_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_arbitrum_sepolia_labels_tx_hash_tx_call_raw", + "arbitrum_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_avalanche_fuji_labels_tx_hash_log_idx_evt_raw", + "avalanche_fuji_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_avalanche_fuji_labels_tx_hash_tx_call_raw", + "avalanche_fuji_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_avalanche_labels_tx_hash_log_idx_evt_raw", + "avalanche_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_avalanche_labels_tx_hash_tx_call_raw", + "avalanche_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_base_labels_tx_hash_log_idx_evt_raw", + "base_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_base_labels_tx_hash_tx_call_raw", + "base_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_blast_labels_tx_hash_log_idx_evt_raw", + "blast_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_blast_labels_tx_hash_tx_call_raw", + "blast_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_blast_sepolia_labels_tx_hash_log_idx_evt_raw", + "blast_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_blast_sepolia_labels_tx_hash_tx_call_raw", + "blast_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_ethereum_labels_tx_hash_log_idx_evt_raw", + "ethereum_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_ethereum_labels_tx_hash_tx_call_raw", + "ethereum_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", + "game7_orbit_arbitrum_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call_raw", + "game7_orbit_arbitrum_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_mantle_labels_tx_hash_log_idx_evt_raw", + "mantle_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_mantle_labels_tx_hash_tx_call_raw", + "mantle_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_mantle_sepolia_labels_tx_hash_log_idx_evt_raw", + "mantle_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_mantle_sepolia_labels_tx_hash_tx_call_raw", + "mantle_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_mumbai_labels_tx_hash_log_idx_evt_raw", + "mumbai_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_mumbai_labels_tx_hash_tx_call_raw", + "mumbai_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_polygon_labels_tx_hash_log_idx_evt_raw", + "polygon_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_polygon_labels_tx_hash_tx_call_raw", + "polygon_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_proofofplay_apex_labels_tx_hash_log_idx_evt_raw", + "proofofplay_apex_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_proofofplay_apex_labels_tx_hash_tx_call_raw", + "proofofplay_apex_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_sepolia_labels_tx_hash_log_idx_evt_raw", + "sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_sepolia_labels_tx_hash_tx_call_raw", + "sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_starknet_labels_tx_hash_log_idx_evt_raw", + "starknet_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_starknet_labels_tx_hash_tx_call_raw", + "starknet_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_starknet_sepolia_labels_tx_hash_log_idx_evt_raw", + "starknet_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_starknet_sepolia_labels_tx_hash_tx_call_raw", + "starknet_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_xai_labels_tx_hash_log_idx_evt_raw", + "xai_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_xai_labels_tx_hash_tx_call_raw", + "xai_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_xai_sepolia_labels_tx_hash_log_idx_evt_raw", + "xai_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_xai_sepolia_labels_tx_hash_tx_call_raw", + "xai_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_xdai_labels_tx_hash_log_idx_evt_raw", + "xdai_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_xdai_labels_tx_hash_tx_call_raw", + "xdai_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_zksync_era_labels_tx_hash_log_idx_evt_raw", + "zksync_era_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_zksync_era_labels_tx_hash_tx_call_raw", + "zksync_era_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.create_index( + "uk_zksync_era_sepolia_labels_tx_hash_log_idx_evt_raw", + "zksync_era_sepolia_labels", + ["transaction_hash", "log_index"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.create_index( + "uk_zksync_era_sepolia_labels_tx_hash_tx_call_raw", + "zksync_era_sepolia_labels", + ["transaction_hash"], + unique=True, + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index( + "uk_zksync_era_sepolia_labels_tx_hash_tx_call_raw", + table_name="zksync_era_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_zksync_era_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="zksync_era_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_zksync_era_labels_tx_hash_tx_call_raw", + table_name="zksync_era_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_zksync_era_labels_tx_hash_log_idx_evt_raw", + table_name="zksync_era_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_xdai_labels_tx_hash_tx_call_raw", + table_name="xdai_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_xdai_labels_tx_hash_log_idx_evt_raw", + table_name="xdai_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_xai_sepolia_labels_tx_hash_tx_call_raw", + table_name="xai_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_xai_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="xai_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_xai_labels_tx_hash_tx_call_raw", + table_name="xai_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_xai_labels_tx_hash_log_idx_evt_raw", + table_name="xai_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_starknet_sepolia_labels_tx_hash_tx_call_raw", + table_name="starknet_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_starknet_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="starknet_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_starknet_labels_tx_hash_tx_call_raw", + table_name="starknet_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_starknet_labels_tx_hash_log_idx_evt_raw", + table_name="starknet_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_sepolia_labels_tx_hash_tx_call_raw", + table_name="sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_proofofplay_apex_labels_tx_hash_tx_call_raw", + table_name="proofofplay_apex_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_proofofplay_apex_labels_tx_hash_log_idx_evt_raw", + table_name="proofofplay_apex_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_polygon_labels_tx_hash_tx_call_raw", + table_name="polygon_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_polygon_labels_tx_hash_log_idx_evt_raw", + table_name="polygon_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_mumbai_labels_tx_hash_tx_call_raw", + table_name="mumbai_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_mumbai_labels_tx_hash_log_idx_evt_raw", + table_name="mumbai_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_mantle_sepolia_labels_tx_hash_tx_call_raw", + table_name="mantle_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_mantle_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="mantle_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_mantle_labels_tx_hash_tx_call_raw", + table_name="mantle_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_mantle_labels_tx_hash_log_idx_evt_raw", + table_name="mantle_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call_raw", + table_name="game7_orbit_arbitrum_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="game7_orbit_arbitrum_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_ethereum_labels_tx_hash_tx_call_raw", + table_name="ethereum_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_ethereum_labels_tx_hash_log_idx_evt_raw", + table_name="ethereum_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_blast_sepolia_labels_tx_hash_tx_call_raw", + table_name="blast_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_blast_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="blast_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_blast_labels_tx_hash_tx_call_raw", + table_name="blast_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_blast_labels_tx_hash_log_idx_evt_raw", + table_name="blast_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_base_labels_tx_hash_tx_call_raw", + table_name="base_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_base_labels_tx_hash_log_idx_evt_raw", + table_name="base_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_avalanche_labels_tx_hash_tx_call_raw", + table_name="avalanche_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_avalanche_labels_tx_hash_log_idx_evt_raw", + table_name="avalanche_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_avalanche_fuji_labels_tx_hash_tx_call_raw", + table_name="avalanche_fuji_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_avalanche_fuji_labels_tx_hash_log_idx_evt_raw", + table_name="avalanche_fuji_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_arbitrum_sepolia_labels_tx_hash_tx_call_raw", + table_name="arbitrum_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", + table_name="arbitrum_sepolia_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_arbitrum_one_labels_tx_hash_tx_call_raw", + table_name="arbitrum_one_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_arbitrum_one_labels_tx_hash_log_idx_evt_raw", + table_name="arbitrum_one_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_arbitrum_nova_labels_tx_hash_tx_call_raw", + table_name="arbitrum_nova_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_arbitrum_nova_labels_tx_hash_log_idx_evt_raw", + table_name="arbitrum_nova_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + op.drop_index( + "uk_amoy_labels_tx_hash_tx_call_raw", + table_name="amoy_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"), + ) + op.drop_index( + "uk_amoy_labels_tx_hash_log_idx_evt_raw", + table_name="amoy_labels", + postgresql_where=sa.text("label='seer-raw' and label_type='event'"), + ) + # ### end Alembic commands ### From d2c40e5aaf3db0da75db395d1977acf6f52ca0c2 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 24 Jul 2024 15:05:29 +0300 Subject: [PATCH 2/2] Add models and bump version. --- moonstreamdb-v3/moonstreamdbv3/models.py | 312 +++++++++++++++++++++ moonstreamdb-v3/moonstreamdbv3/version.txt | 2 +- 2 files changed, 313 insertions(+), 1 deletion(-) diff --git a/moonstreamdb-v3/moonstreamdbv3/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index 781c887f..99a3f3c5 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -148,6 +148,19 @@ class EthereumLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_ethereum_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_ethereum_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -180,6 +193,19 @@ class SepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -212,6 +238,19 @@ class PolygonLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_polygon_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_polygon_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -244,6 +283,19 @@ class MumbaiLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_mumbai_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_mumbai_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -276,6 +328,19 @@ class AmoyLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_amoy_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_amoy_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -308,6 +373,19 @@ class XDaiLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_xdai_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_xdai_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -340,6 +418,19 @@ class ZkSyncEraLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_zksync_era_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_zksync_era_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -372,6 +463,19 @@ class ZkSyncEraSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_zksync_era_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_zksync_era_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -404,6 +508,19 @@ class BaseLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_base_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_base_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -436,6 +553,19 @@ class ArbitrumNovaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_arbitrum_nova_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_arbitrum_nova_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -468,6 +598,19 @@ class ArbitrumOneLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_arbitrum_one_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_arbitrum_one_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -500,6 +643,19 @@ class ArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_arbitrum_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -532,6 +688,19 @@ class Game7OrbitArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -564,6 +733,19 @@ class XaiLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_xai_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_xai_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -596,6 +778,19 @@ class XaiSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_xai_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_xai_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -628,6 +823,19 @@ class AvalancheLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_avalanche_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_avalanche_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -660,6 +868,19 @@ class AvalancheFujiLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_avalanche_fuji_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_avalanche_fuji_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -692,6 +913,19 @@ class BlastLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_blast_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_blast_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -724,6 +958,19 @@ class BlastSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_blast_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_blast_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -756,6 +1003,19 @@ class ProofOfPlayApexLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_proofofplay_apex_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_proofofplay_apex_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -788,6 +1048,19 @@ class StarknetLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_starknet_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_starknet_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -820,6 +1093,19 @@ class StarknetSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_starknet_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_starknet_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -852,6 +1138,19 @@ class MantleLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_mantle_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_mantle_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) @@ -884,4 +1183,17 @@ class MantleSepoliaLabel(EvmBasedLabel): # type: ignore unique=True, postgresql_where=text("label='seer' and label_type='event'"), ), + Index( + "uk_mantle_sepolia_labels_tx_hash_tx_call_raw", + "transaction_hash", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'"), + ), + Index( + "uk_mantle_sepolia_labels_tx_hash_log_idx_evt_raw", + "transaction_hash", + "log_index", + unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'"), + ), ) diff --git a/moonstreamdb-v3/moonstreamdbv3/version.txt b/moonstreamdb-v3/moonstreamdbv3/version.txt index 43b29618..9789c4cc 100644 --- a/moonstreamdb-v3/moonstreamdbv3/version.txt +++ b/moonstreamdb-v3/moonstreamdbv3/version.txt @@ -1 +1 @@ -0.0.13 +0.0.14