Skip to content

Commit

Permalink
rename sepolia -> saigon.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey committed Nov 12, 2024
1 parent 415573a commit 3242308
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 123 deletions.
4 changes: 2 additions & 2 deletions moonstreamdb-v3/moonstreamdbv3/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
PolygonLabel,
ProofOfPlayApexLabel,
RoninLabel,
RoninSepoliaLabel,
RoninSaigonLabel,
SepoliaLabel,
StarknetLabel,
StarknetSepoliaLabel,
Expand Down Expand Up @@ -94,7 +94,7 @@ def include_symbol(tablename, schema):
B3Label.__tablename__,
B3SepoliaLabel.__tablename__,
RoninLabel.__tablename__,
RoninSepoliaLabel.__tablename__,
RoninSaigonLabel.__tablename__,
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""add ronin
"""add ronin chain
Revision ID: f8ea378cffbf
Revision ID: e6d3c285e7cc
Revises: d816689b786a
Create Date: 2024-11-11 16:16:09.255737
Create Date: 2024-11-12 12:54:33.415972
"""

Expand All @@ -13,7 +13,7 @@
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = "f8ea378cffbf"
revision: str = "e6d3c285e7cc"
down_revision: Union[str, None] = "d816689b786a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
Expand Down Expand Up @@ -122,7 +122,7 @@ def upgrade() -> None:
postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"),
)
op.create_table(
"ronin_sepolia_labels",
"ronin_saigon_labels",
sa.Column("id", sa.UUID(), nullable=False),
sa.Column("label", sa.VARCHAR(length=256), nullable=False),
sa.Column("transaction_hash", sa.VARCHAR(length=128), nullable=False),
Expand All @@ -142,155 +142,154 @@ def upgrade() -> None:
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
nullable=False,
),
sa.PrimaryKeyConstraint("id", name=op.f("pk_ronin_sepolia_labels")),
sa.UniqueConstraint("id", name=op.f("uq_ronin_sepolia_labels_id")),
sa.PrimaryKeyConstraint("id", name=op.f("pk_ronin_saigon_labels")),
sa.UniqueConstraint("id", name=op.f("uq_ronin_saigon_labels_id")),
)
op.create_index(
"ix_ronin_sepolia_labels_addr_block_num",
"ronin_sepolia_labels",
"ix_ronin_saigon_labels_addr_block_num",
"ronin_saigon_labels",
["address", "block_number"],
unique=False,
)
op.create_index(
"ix_ronin_sepolia_labels_addr_block_ts",
"ronin_sepolia_labels",
"ix_ronin_saigon_labels_addr_block_ts",
"ronin_saigon_labels",
["address", "block_timestamp"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_address"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_address"),
"ronin_saigon_labels",
["address"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_block_number"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_block_number"),
"ronin_saigon_labels",
["block_number"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_caller_address"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_caller_address"),
"ronin_saigon_labels",
["caller_address"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_label"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_label"),
"ronin_saigon_labels",
["label"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_label_name"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_label_name"),
"ronin_saigon_labels",
["label_name"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_label_type"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_label_type"),
"ronin_saigon_labels",
["label_type"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_origin_address"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_origin_address"),
"ronin_saigon_labels",
["origin_address"],
unique=False,
)
op.create_index(
op.f("ix_ronin_sepolia_labels_transaction_hash"),
"ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_transaction_hash"),
"ronin_saigon_labels",
["transaction_hash"],
unique=False,
)
op.create_index(
"uk_ronin_sepolia_labels_tx_hash_log_idx_evt",
"ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_log_idx_evt",
"ronin_saigon_labels",
["transaction_hash", "log_index"],
unique=True,
postgresql_where=sa.text("label='seer' and label_type='event'"),
)
op.create_index(
"uk_ronin_sepolia_labels_tx_hash_log_idx_evt_raw",
"ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_log_idx_evt_raw",
"ronin_saigon_labels",
["transaction_hash", "log_index"],
unique=True,
postgresql_where=sa.text("label='seer-raw' and label_type='event'"),
)
op.create_index(
"uk_ronin_sepolia_labels_tx_hash_tx_call",
"ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_tx_call",
"ronin_saigon_labels",
["transaction_hash"],
unique=True,
postgresql_where=sa.text("label='seer' and label_type='tx_call'"),
)
op.create_index(
"uk_ronin_sepolia_labels_tx_hash_tx_call_raw",
"ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_tx_call_raw",
"ronin_saigon_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_ronin_sepolia_labels_tx_hash_tx_call_raw",
table_name="ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_tx_call_raw",
table_name="ronin_saigon_labels",
postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"),
)
op.drop_index(
"uk_ronin_sepolia_labels_tx_hash_tx_call",
table_name="ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_tx_call",
table_name="ronin_saigon_labels",
postgresql_where=sa.text("label='seer' and label_type='tx_call'"),
)
op.drop_index(
"uk_ronin_sepolia_labels_tx_hash_log_idx_evt_raw",
table_name="ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_log_idx_evt_raw",
table_name="ronin_saigon_labels",
postgresql_where=sa.text("label='seer-raw' and label_type='event'"),
)
op.drop_index(
"uk_ronin_sepolia_labels_tx_hash_log_idx_evt",
table_name="ronin_sepolia_labels",
"uk_ronin_saigon_labels_tx_hash_log_idx_evt",
table_name="ronin_saigon_labels",
postgresql_where=sa.text("label='seer' and label_type='event'"),
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_transaction_hash"),
table_name="ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_transaction_hash"),
table_name="ronin_saigon_labels",
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_origin_address"),
table_name="ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_origin_address"), table_name="ronin_saigon_labels"
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_label_type"), table_name="ronin_sepolia_labels"
op.f("ix_ronin_saigon_labels_label_type"), table_name="ronin_saigon_labels"
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_label_name"), table_name="ronin_sepolia_labels"
op.f("ix_ronin_saigon_labels_label_name"), table_name="ronin_saigon_labels"
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_label"), table_name="ronin_sepolia_labels"
op.f("ix_ronin_saigon_labels_label"), table_name="ronin_saigon_labels"
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_caller_address"),
table_name="ronin_sepolia_labels",
op.f("ix_ronin_saigon_labels_caller_address"), table_name="ronin_saigon_labels"
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_block_number"), table_name="ronin_sepolia_labels"
op.f("ix_ronin_saigon_labels_block_number"), table_name="ronin_saigon_labels"
)
op.drop_index(
op.f("ix_ronin_sepolia_labels_address"), table_name="ronin_sepolia_labels"
op.f("ix_ronin_saigon_labels_address"), table_name="ronin_saigon_labels"
)
op.drop_index(
"ix_ronin_sepolia_labels_addr_block_ts", table_name="ronin_sepolia_labels"
"ix_ronin_saigon_labels_addr_block_ts", table_name="ronin_saigon_labels"
)
op.drop_index(
"ix_ronin_sepolia_labels_addr_block_num", table_name="ronin_sepolia_labels"
"ix_ronin_saigon_labels_addr_block_num", table_name="ronin_saigon_labels"
)
op.drop_table("ronin_sepolia_labels")
op.drop_table("ronin_saigon_labels")
op.drop_index(
"uk_ronin_labels_tx_hash_tx_call_raw",
table_name="ronin_labels",
Expand Down
12 changes: 6 additions & 6 deletions moonstreamdb-v3/moonstreamdbv3/alembic_indexes/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
RoninBlockIndex,
RoninReorgs,
RoninContracts,
RoninSepoliaBlockIndex,
RoninSepoliaReorgs,
RoninSepoliaContracts,
RoninSaigonBlockIndex,
RoninSaigonReorgs,
RoninSaigonContracts,
XaiBlockIndex,
XaiLogIndex,
XaiReorgs,
Expand Down Expand Up @@ -152,9 +152,9 @@ def include_symbol(tablename, schema):
RoninBlockIndex.__tablename__,
RoninReorgs.__tablename__,
RoninContracts.__tablename__,
RoninSepoliaBlockIndex.__tablename__,
RoninSepoliaReorgs.__tablename__,
RoninSepoliaContracts.__tablename__,
RoninSaigonBlockIndex.__tablename__,
RoninSaigonReorgs.__tablename__,
RoninSaigonContracts.__tablename__,
}


Expand Down
Loading

0 comments on commit 3242308

Please sign in to comment.