"""indexer sync status

Revision ID: 7a7704f044db
Revises: b8e019bf7710
Create Date: 2023-03-10 12:09:40.409813

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "7a7704f044db"
down_revision = "b8e019bf7710"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "indexer_sync_status",
        sa.Column("chain", sa.String(), nullable=False),
        sa.Column("event_type", sa.String(), nullable=False),
        sa.Column("start_block_datetime", sa.TIMESTAMP(timezone=True), nullable=False),
        sa.Column("end_block_datetime", sa.TIMESTAMP(timezone=True), nullable=False),
        sa.Column("start_included", sa.Boolean, nullable=False),
        sa.Column("end_included", sa.Boolean, nullable=False),
        sa.Column("last_updated", sa.TIMESTAMP(timezone=True), nullable=False),
        sa.PrimaryKeyConstraint("chain", "event_type", "start_block_datetime"),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("indexer_sync_status")
    # ### end Alembic commands ###
