pull/1130/head
Andrey 2024-09-29 22:06:20 +03:00
rodzic 06cb14871c
commit 39e0bea429
1 zmienionych plików z 778 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,778 @@
"""Add contracts storage
Revision ID: 759a219ef4fd
Revises: 6807bdf6f417
Create Date: 2024-09-29 22:04:11.974197
"""
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 = "759a219ef4fd"
down_revision: Union[str, None] = "6807bdf6f417"
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(
"bytecode_storage",
sa.Column("id", sa.UUID(), nullable=False),
sa.Column("hash", sa.Text(), nullable=False),
sa.Column("bytecode", sa.Text(), nullable=False),
sa.Column("title", sa.VARCHAR(length=256), nullable=True),
sa.Column("description", sa.Text(), nullable=True),
sa.Column("Abi", sa.Text(), nullable=True),
sa.Column("code", sa.Text(), nullable=True),
sa.Column("data", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.PrimaryKeyConstraint("id", name=op.f("pk_bytecode_storage")),
sa.UniqueConstraint("hash", name="uq_bytecode_storage_hash"),
)
op.create_index(
op.f("ix_bytecode_storage_hash"), "bytecode_storage", ["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")),
)
# ### 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_bytecode_storage_hash"), table_name="bytecode_storage")
op.drop_table("bytecode_storage")
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 ###