-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1125 from moonstream-to/indexed-at-columns
Add indexed at columns for logs and transactions.
- Loading branch information
Showing
3 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
159 changes: 159 additions & 0 deletions
159
...nstreamdbv3/alembic_indexes/versions/48d2562504d1_add_indexed_at_logs_and_transactions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
"""Add indexed_at logs and transactions | ||
Revision ID: 48d2562504d1 | ||
Revises: b89a8affe2c3 | ||
Create Date: 2024-08-20 17:08:34.493114 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "48d2562504d1" | ||
down_revision: Union[str, None] = "b89a8affe2c3" | ||
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_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"arbitrum_one_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"arbitrum_sepolia_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"arbitrum_sepolia_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"ethereum_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"ethereum_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"game7_orbit_arbitrum_sepolia_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"game7_orbit_arbitrum_sepolia_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"game7_testnet_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"game7_testnet_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"imx_zkevm_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"imx_zkevm_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"imx_zkevm_sepolia_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"imx_zkevm_sepolia_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"mantle_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"mantle_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"mantle_sepolia_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"mantle_sepolia_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"polygon_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"polygon_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"sepolia_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"sepolia_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"xai_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"xai_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"xai_sepolia_blocks", | ||
sa.Column("transactions_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"xai_sepolia_blocks", | ||
sa.Column("logs_indexed_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("xai_sepolia_blocks", "logs_indexed_at") | ||
op.drop_column("xai_sepolia_blocks", "transactions_indexed_at") | ||
op.drop_column("xai_blocks", "logs_indexed_at") | ||
op.drop_column("xai_blocks", "transactions_indexed_at") | ||
op.drop_column("sepolia_blocks", "logs_indexed_at") | ||
op.drop_column("sepolia_blocks", "transactions_indexed_at") | ||
op.drop_column("polygon_blocks", "logs_indexed_at") | ||
op.drop_column("polygon_blocks", "transactions_indexed_at") | ||
op.drop_column("mantle_sepolia_blocks", "logs_indexed_at") | ||
op.drop_column("mantle_sepolia_blocks", "transactions_indexed_at") | ||
op.drop_column("mantle_blocks", "logs_indexed_at") | ||
op.drop_column("mantle_blocks", "transactions_indexed_at") | ||
op.drop_column("imx_zkevm_sepolia_blocks", "logs_indexed_at") | ||
op.drop_column("imx_zkevm_sepolia_blocks", "transactions_indexed_at") | ||
op.drop_column("imx_zkevm_blocks", "logs_indexed_at") | ||
op.drop_column("imx_zkevm_blocks", "transactions_indexed_at") | ||
op.drop_column("game7_testnet_blocks", "logs_indexed_at") | ||
op.drop_column("game7_testnet_blocks", "transactions_indexed_at") | ||
op.drop_column("game7_orbit_arbitrum_sepolia_blocks", "logs_indexed_at") | ||
op.drop_column("game7_orbit_arbitrum_sepolia_blocks", "transactions_indexed_at") | ||
op.drop_column("ethereum_blocks", "logs_indexed_at") | ||
op.drop_column("ethereum_blocks", "transactions_indexed_at") | ||
op.drop_column("arbitrum_sepolia_blocks", "logs_indexed_at") | ||
op.drop_column("arbitrum_sepolia_blocks", "transactions_indexed_at") | ||
op.drop_column("arbitrum_one_blocks", "logs_indexed_at") | ||
op.drop_column("arbitrum_one_blocks", "transactions_indexed_at") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.16 | ||
0.0.17 |