kopia lustrzana https://github.com/bugout-dev/moonstream
Restructure of contracts table.
rodzic
ab842b1577
commit
2d84d2ba77
|
@ -1,772 +0,0 @@
|
||||||
"""Add contracts tables
|
|
||||||
|
|
||||||
Revision ID: 9fcb95ce7d08
|
|
||||||
Revises: 25b339f55f8f
|
|
||||||
Create Date: 2024-09-17 17:41:56.117210
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
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 = "9fcb95ce7d08"
|
|
||||||
down_revision: Union[str, None] = "25b339f55f8f"
|
|
||||||
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_table(
|
|
||||||
"arbitrum_one_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_arbitrum_one_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_arbitrum_one_contracts_name"),
|
|
||||||
"arbitrum_one_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_arbitrum_one_contracts_transaction_hash"),
|
|
||||||
"arbitrum_one_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"arbitrum_sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_arbitrum_sepolia_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_arbitrum_sepolia_contracts_name"),
|
|
||||||
"arbitrum_sepolia_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_arbitrum_sepolia_contracts_transaction_hash"),
|
|
||||||
"arbitrum_sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"b3_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_b3_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_b3_contracts_name"), "b3_contracts", ["name"], unique=False
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_b3_contracts_transaction_hash"),
|
|
||||||
"b3_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"b3_sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_b3_sepolia_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_b3_sepolia_contracts_name"),
|
|
||||||
"b3_sepolia_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_b3_sepolia_contracts_transaction_hash"),
|
|
||||||
"b3_sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"ethereum_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_ethereum_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_ethereum_contracts_name"), "ethereum_contracts", ["name"], unique=False
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_ethereum_contracts_transaction_hash"),
|
|
||||||
"ethereum_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"game7_orbit_arbitrum_sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint(
|
|
||||||
"address", name=op.f("pk_game7_orbit_arbitrum_sepolia_contracts")
|
|
||||||
),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_game7_orbit_arbitrum_sepolia_contracts_name"),
|
|
||||||
"game7_orbit_arbitrum_sepolia_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_game7_orbit_arbitrum_sepolia_contracts_transaction_hash"),
|
|
||||||
"game7_orbit_arbitrum_sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"game7_testnet_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_game7_testnet_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_game7_testnet_contracts_name"),
|
|
||||||
"game7_testnet_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_game7_testnet_contracts_transaction_hash"),
|
|
||||||
"game7_testnet_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"imx_zkevm_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_imx_zkevm_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_imx_zkevm_contracts_name"),
|
|
||||||
"imx_zkevm_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_imx_zkevm_contracts_transaction_hash"),
|
|
||||||
"imx_zkevm_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"imx_zkevm_sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_imx_zkevm_sepolia_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_imx_zkevm_sepolia_contracts_name"),
|
|
||||||
"imx_zkevm_sepolia_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_imx_zkevm_sepolia_contracts_transaction_hash"),
|
|
||||||
"imx_zkevm_sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"mantle_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_mantle_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_mantle_contracts_name"), "mantle_contracts", ["name"], unique=False
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_mantle_contracts_transaction_hash"),
|
|
||||||
"mantle_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"mantle_sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_mantle_sepolia_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_mantle_sepolia_contracts_name"),
|
|
||||||
"mantle_sepolia_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_mantle_sepolia_contracts_transaction_hash"),
|
|
||||||
"mantle_sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"polygon_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_polygon_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_polygon_contracts_name"), "polygon_contracts", ["name"], unique=False
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_polygon_contracts_transaction_hash"),
|
|
||||||
"polygon_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_sepolia_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_sepolia_contracts_name"), "sepolia_contracts", ["name"], unique=False
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_sepolia_contracts_transaction_hash"),
|
|
||||||
"sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"xai_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_xai_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_xai_contracts_name"), "xai_contracts", ["name"], unique=False
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_xai_contracts_transaction_hash"),
|
|
||||||
"xai_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_table(
|
|
||||||
"xai_sepolia_contracts",
|
|
||||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
|
||||||
sa.Column("bytecode", sa.Text(), nullable=True),
|
|
||||||
sa.Column("deployed_bytecode", sa.Text(), nullable=False),
|
|
||||||
sa.Column("abi", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column("deployed_at_block_number", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("deployed_at_block_timestamp", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
|
||||||
sa.Column("transaction_index", sa.BigInteger(), nullable=False),
|
|
||||||
sa.Column("name", sa.VARCHAR(length=256), nullable=True),
|
|
||||||
sa.Column("statistics", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column(
|
|
||||||
"supported_standards",
|
|
||||||
postgresql.JSONB(astext_type=sa.Text()),
|
|
||||||
nullable=True,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"created_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.Column(
|
|
||||||
"updated_at",
|
|
||||||
sa.DateTime(timezone=True),
|
|
||||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
|
||||||
nullable=False,
|
|
||||||
),
|
|
||||||
sa.PrimaryKeyConstraint("address", name=op.f("pk_xai_sepolia_contracts")),
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_xai_sepolia_contracts_name"),
|
|
||||||
"xai_sepolia_contracts",
|
|
||||||
["name"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
op.create_index(
|
|
||||||
op.f("ix_xai_sepolia_contracts_transaction_hash"),
|
|
||||||
"xai_sepolia_contracts",
|
|
||||||
["transaction_hash"],
|
|
||||||
unique=False,
|
|
||||||
)
|
|
||||||
# ### end Alembic commands ###
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_xai_sepolia_contracts_transaction_hash"),
|
|
||||||
table_name="xai_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_xai_sepolia_contracts_name"), table_name="xai_sepolia_contracts"
|
|
||||||
)
|
|
||||||
op.drop_table("xai_sepolia_contracts")
|
|
||||||
op.drop_index(op.f("ix_xai_contracts_transaction_hash"), table_name="xai_contracts")
|
|
||||||
op.drop_index(op.f("ix_xai_contracts_name"), table_name="xai_contracts")
|
|
||||||
op.drop_table("xai_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_sepolia_contracts_transaction_hash"), table_name="sepolia_contracts"
|
|
||||||
)
|
|
||||||
op.drop_index(op.f("ix_sepolia_contracts_name"), table_name="sepolia_contracts")
|
|
||||||
op.drop_table("sepolia_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_polygon_contracts_transaction_hash"), table_name="polygon_contracts"
|
|
||||||
)
|
|
||||||
op.drop_index(op.f("ix_polygon_contracts_name"), table_name="polygon_contracts")
|
|
||||||
op.drop_table("polygon_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_mantle_sepolia_contracts_transaction_hash"),
|
|
||||||
table_name="mantle_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_mantle_sepolia_contracts_name"), table_name="mantle_sepolia_contracts"
|
|
||||||
)
|
|
||||||
op.drop_table("mantle_sepolia_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_mantle_contracts_transaction_hash"), table_name="mantle_contracts"
|
|
||||||
)
|
|
||||||
op.drop_index(op.f("ix_mantle_contracts_name"), table_name="mantle_contracts")
|
|
||||||
op.drop_table("mantle_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_imx_zkevm_sepolia_contracts_transaction_hash"),
|
|
||||||
table_name="imx_zkevm_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_imx_zkevm_sepolia_contracts_name"),
|
|
||||||
table_name="imx_zkevm_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_table("imx_zkevm_sepolia_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_imx_zkevm_contracts_transaction_hash"),
|
|
||||||
table_name="imx_zkevm_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(op.f("ix_imx_zkevm_contracts_name"), table_name="imx_zkevm_contracts")
|
|
||||||
op.drop_table("imx_zkevm_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_game7_testnet_contracts_transaction_hash"),
|
|
||||||
table_name="game7_testnet_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_game7_testnet_contracts_name"), table_name="game7_testnet_contracts"
|
|
||||||
)
|
|
||||||
op.drop_table("game7_testnet_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_game7_orbit_arbitrum_sepolia_contracts_transaction_hash"),
|
|
||||||
table_name="game7_orbit_arbitrum_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_game7_orbit_arbitrum_sepolia_contracts_name"),
|
|
||||||
table_name="game7_orbit_arbitrum_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_table("game7_orbit_arbitrum_sepolia_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_ethereum_contracts_transaction_hash"), table_name="ethereum_contracts"
|
|
||||||
)
|
|
||||||
op.drop_index(op.f("ix_ethereum_contracts_name"), table_name="ethereum_contracts")
|
|
||||||
op.drop_table("ethereum_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_b3_sepolia_contracts_transaction_hash"),
|
|
||||||
table_name="b3_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_b3_sepolia_contracts_name"), table_name="b3_sepolia_contracts"
|
|
||||||
)
|
|
||||||
op.drop_table("b3_sepolia_contracts")
|
|
||||||
op.drop_index(op.f("ix_b3_contracts_transaction_hash"), table_name="b3_contracts")
|
|
||||||
op.drop_index(op.f("ix_b3_contracts_name"), table_name="b3_contracts")
|
|
||||||
op.drop_table("b3_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_arbitrum_sepolia_contracts_transaction_hash"),
|
|
||||||
table_name="arbitrum_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_arbitrum_sepolia_contracts_name"),
|
|
||||||
table_name="arbitrum_sepolia_contracts",
|
|
||||||
)
|
|
||||||
op.drop_table("arbitrum_sepolia_contracts")
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_arbitrum_one_contracts_transaction_hash"),
|
|
||||||
table_name="arbitrum_one_contracts",
|
|
||||||
)
|
|
||||||
op.drop_index(
|
|
||||||
op.f("ix_arbitrum_one_contracts_name"), table_name="arbitrum_one_contracts"
|
|
||||||
)
|
|
||||||
op.drop_table("arbitrum_one_contracts")
|
|
||||||
# ### end Alembic commands ###
|
|
|
@ -927,3 +927,19 @@ class AbiSubscriptions(Base):
|
||||||
created_at = Column(
|
created_at = Column(
|
||||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class BytecodeStorage(Base):
|
||||||
|
|
||||||
|
__tablename__ = "bytecode_storage"
|
||||||
|
|
||||||
|
__table_args__ = (UniqueConstraint("hash", name="uq_bytecode_storage_hash"),)
|
||||||
|
|
||||||
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||||
|
hash = Column(Text, nullable=False, index=True)
|
||||||
|
bytecode = Column(Text, nullable=False)
|
||||||
|
title = Column(VARCHAR(256), nullable=True)
|
||||||
|
description = Column(Text, nullable=True)
|
||||||
|
Abi = Column(Text, nullable=True)
|
||||||
|
code = Column(Text, nullable=True)
|
||||||
|
metadata = Column(JSONB, nullable=True)
|
||||||
|
|
Ładowanie…
Reference in New Issue