Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployer address. #1135

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
"""Add deployed by column

Revision ID: 5ce23893771f
Revises: 82ff1541f4b4
Create Date: 2024-11-07 14:03:31.833443

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "5ce23893771f"
down_revision: Union[str, None] = "82ff1541f4b4"
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.add_column(
"arbitrum_one_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_arbitrum_one_contracts_deployed_by"),
"arbitrum_one_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"arbitrum_sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_arbitrum_sepolia_contracts_deployed_by"),
"arbitrum_sepolia_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"b3_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_b3_contracts_deployed_by"),
"b3_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"b3_sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_b3_sepolia_contracts_deployed_by"),
"b3_sepolia_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"ethereum_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_ethereum_contracts_deployed_by"),
"ethereum_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"game7_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_game7_contracts_deployed_by"),
"game7_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"game7_orbit_arbitrum_sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_game7_orbit_arbitrum_sepolia_contracts_deployed_by"),
"game7_orbit_arbitrum_sepolia_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"game7_testnet_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_game7_testnet_contracts_deployed_by"),
"game7_testnet_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"imx_zkevm_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_imx_zkevm_contracts_deployed_by"),
"imx_zkevm_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"imx_zkevm_sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_imx_zkevm_sepolia_contracts_deployed_by"),
"imx_zkevm_sepolia_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"mantle_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_mantle_contracts_deployed_by"),
"mantle_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"mantle_sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_mantle_sepolia_contracts_deployed_by"),
"mantle_sepolia_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"polygon_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_polygon_contracts_deployed_by"),
"polygon_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_sepolia_contracts_deployed_by"),
"sepolia_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"xai_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_xai_contracts_deployed_by"),
"xai_contracts",
["deployed_by"],
unique=False,
)
op.add_column(
"xai_sepolia_contracts",
sa.Column("deployed_by", sa.LargeBinary(length=20), nullable=False),
)
op.create_index(
op.f("ix_xai_sepolia_contracts_deployed_by"),
"xai_sepolia_contracts",
["deployed_by"],
unique=False,
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(
op.f("ix_xai_sepolia_contracts_deployed_by"), table_name="xai_sepolia_contracts"
)
op.drop_column("xai_sepolia_contracts", "deployed_by")
op.drop_index(op.f("ix_xai_contracts_deployed_by"), table_name="xai_contracts")
op.drop_column("xai_contracts", "deployed_by")
op.drop_index(
op.f("ix_sepolia_contracts_deployed_by"), table_name="sepolia_contracts"
)
op.drop_column("sepolia_contracts", "deployed_by")
op.drop_index(
op.f("ix_polygon_contracts_deployed_by"), table_name="polygon_contracts"
)
op.drop_column("polygon_contracts", "deployed_by")
op.drop_index(
op.f("ix_mantle_sepolia_contracts_deployed_by"),
table_name="mantle_sepolia_contracts",
)
op.drop_column("mantle_sepolia_contracts", "deployed_by")
op.drop_index(
op.f("ix_mantle_contracts_deployed_by"), table_name="mantle_contracts"
)
op.drop_column("mantle_contracts", "deployed_by")
op.drop_index(
op.f("ix_imx_zkevm_sepolia_contracts_deployed_by"),
table_name="imx_zkevm_sepolia_contracts",
)
op.drop_column("imx_zkevm_sepolia_contracts", "deployed_by")
op.drop_index(
op.f("ix_imx_zkevm_contracts_deployed_by"), table_name="imx_zkevm_contracts"
)
op.drop_column("imx_zkevm_contracts", "deployed_by")
op.drop_index(
op.f("ix_game7_testnet_contracts_deployed_by"),
table_name="game7_testnet_contracts",
)
op.drop_column("game7_testnet_contracts", "deployed_by")
op.drop_index(
op.f("ix_game7_orbit_arbitrum_sepolia_contracts_deployed_by"),
table_name="game7_orbit_arbitrum_sepolia_contracts",
)
op.drop_column("game7_orbit_arbitrum_sepolia_contracts", "deployed_by")
op.drop_index(op.f("ix_game7_contracts_deployed_by"), table_name="game7_contracts")
op.drop_column("game7_contracts", "deployed_by")
op.drop_index(
op.f("ix_ethereum_contracts_deployed_by"), table_name="ethereum_contracts"
)
op.drop_column("ethereum_contracts", "deployed_by")
op.drop_index(
op.f("ix_b3_sepolia_contracts_deployed_by"), table_name="b3_sepolia_contracts"
)
op.drop_column("b3_sepolia_contracts", "deployed_by")
op.drop_index(op.f("ix_b3_contracts_deployed_by"), table_name="b3_contracts")
op.drop_column("b3_contracts", "deployed_by")
op.drop_index(
op.f("ix_arbitrum_sepolia_contracts_deployed_by"),
table_name="arbitrum_sepolia_contracts",
)
op.drop_column("arbitrum_sepolia_contracts", "deployed_by")
op.drop_index(
op.f("ix_arbitrum_one_contracts_deployed_by"),
table_name="arbitrum_one_contracts",
)
op.drop_column("arbitrum_one_contracts", "deployed_by")
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions moonstreamdb-v3/moonstreamdbv3/models_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class EvmBasedReorgs(Base):
class evmBasedContracts(Base):
__abstract__ = True
address = Column(LargeBinary(length=20), primary_key=True, nullable=False)
deployed_by = Column(LargeBinary(length=20), nullable=False, index=True)
deployed_bytecode = Column(Text, nullable=False)
deployed_bytecode_hash = Column(
VARCHAR(32), nullable=False, index=True
Expand Down
2 changes: 1 addition & 1 deletion moonstreamdb-v3/moonstreamdbv3/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1
Loading