kopia lustrzana https://github.com/bugout-dev/moonstream
Add address selector index.
rodzic
cd7ab58ec1
commit
1ab1a9cc38
|
@ -0,0 +1,36 @@
|
||||||
|
"""Logs address selector index
|
||||||
|
|
||||||
|
Revision ID: 361e59cdcd85
|
||||||
|
Revises: a4ef4f9031e4
|
||||||
|
Create Date: 2024-06-06 12:33:11.672367
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Sequence, Union
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision: str = "361e59cdcd85"
|
||||||
|
down_revision: Union[str, None] = "a4ef4f9031e4"
|
||||||
|
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(
|
||||||
|
"idx_polygon_logs_address_selector",
|
||||||
|
"polygon_logs",
|
||||||
|
["address", "selector"],
|
||||||
|
unique=False,
|
||||||
|
)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_index("idx_polygon_logs_address_selector", table_name="polygon_logs")
|
||||||
|
# ### end Alembic commands ###
|
|
@ -172,6 +172,7 @@ class PolygonLogIndex(EvmBasedLogs):
|
||||||
__tablename__ = "polygon_logs"
|
__tablename__ = "polygon_logs"
|
||||||
|
|
||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
|
Index("idx_polygon_logs_address_selector", "address", "selector"),
|
||||||
UniqueConstraint(
|
UniqueConstraint(
|
||||||
"transaction_hash",
|
"transaction_hash",
|
||||||
"log_index",
|
"log_index",
|
||||||
|
|
Ładowanie…
Reference in New Issue