"""Add ledger table

Revision ID: f8bce8f27431
Revises: 04755a580255
Create Date: 2024-07-10 22:52:25.281419+00:00

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "f8bce8f27431"
down_revision: Union[str, None] = "04755a580255"
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(
        "latest_ledger",
        sa.Column("ledger", sa.Integer(), nullable=False),
        sa.PrimaryKeyConstraint("ledger"),
    )
    op.add_column("event", sa.Column("ledger", sa.Integer(), nullable=False))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("event", "ledger")
    op.drop_table("latest_ledger")
    # ### end Alembic commands ###
