kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #1061 from moonstream-to/zksync-label-data-name-index
Add zksync address label_data name indexpull/1064/head moonstreamdb/v0.4.3
commit
135af1765c
|
@ -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 ###
|
|
@ -15,7 +15,7 @@ from sqlalchemy import (
|
||||||
from sqlalchemy.dialects.postgresql import JSONB, UUID
|
from sqlalchemy.dialects.postgresql import JSONB, UUID
|
||||||
from sqlalchemy.ext.compiler import compiles
|
from sqlalchemy.ext.compiler import compiles
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from sqlalchemy.sql import expression
|
from sqlalchemy.sql import expression, text
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Naming conventions doc
|
Naming conventions doc
|
||||||
|
@ -759,6 +759,12 @@ class ZkSyncEraLabel(Base): # type: ignore
|
||||||
"block_timestamp",
|
"block_timestamp",
|
||||||
unique=False,
|
unique=False,
|
||||||
),
|
),
|
||||||
|
Index(
|
||||||
|
"ix_zksync_era_labels_address_label_data_name",
|
||||||
|
"address",
|
||||||
|
text("(label_data ->> 'name')"),
|
||||||
|
postgresql_using="btree",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
id = Column(
|
id = Column(
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
Moonstream database version.
|
Moonstream database version.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
MOONSTREAMDB_VERSION = "0.4.2"
|
MOONSTREAMDB_VERSION = "0.4.3"
|
||||||
|
|
Ładowanie…
Reference in New Issue