Merge pull request #1061 from moonstream-to/zksync-label-data-name-index

Add zksync address label_data name index
pull/1064/head moonstreamdb/v0.4.3
Andrey Dolgolev 2024-04-29 16:41:09 +03:00 zatwierdzone przez GitHub
commit 135af1765c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
3 zmienionych plików z 47 dodań i 2 usunięć

Wyświetl plik

@ -0,0 +1,39 @@
"""zksync address label_data name index
Revision ID: 6f7c8d64d49a
Revises: a1d9fab5f904
Create Date: 2024-04-29 15:26:43.880238
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "6f7c8d64d49a"
down_revision = "a1d9fab5f904"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(
"ix_zksync_era_labels_address_label_data_name",
"zksync_era_labels",
["address", sa.text("(label_data ->> 'name')")],
unique=False,
postgresql_using="btree",
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(
"ix_zksync_era_labels_address_label_data_name",
table_name="zksync_era_labels",
postgresql_using="btree",
)
# ### end Alembic commands ###

Wyświetl plik

@ -15,7 +15,7 @@ from sqlalchemy import (
from sqlalchemy.dialects.postgresql import JSONB, UUID
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import expression
from sqlalchemy.sql import expression, text
"""
Naming conventions doc
@ -759,6 +759,12 @@ class ZkSyncEraLabel(Base): # type: ignore
"block_timestamp",
unique=False,
),
Index(
"ix_zksync_era_labels_address_label_data_name",
"address",
text("(label_data ->> 'name')"),
postgresql_using="btree",
),
)
id = Column(

Wyświetl plik

@ -2,4 +2,4 @@
Moonstream database version.
"""
MOONSTREAMDB_VERSION = "0.4.2"
MOONSTREAMDB_VERSION = "0.4.3"