"""initial schema

Revision ID: e982668f2bbe
Revises:
Create Date: 2025-04-30 20:55:37.762688+00:00

"""

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "e982668f2bbe"
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "balances",
        sa.Column("chain_id", sa.Integer(), nullable=False),
        sa.Column("token_address", sa.LargeBinary(), nullable=False),
        sa.Column("wallet_address", sa.LargeBinary(), nullable=False),
        sa.Column("value", sa.DECIMAL(precision=62, scale=0), nullable=True),
        sa.Column("block_number", sa.BigInteger(), nullable=True),
        sa.Column("log_index", sa.BigInteger(), nullable=True),
        sa.PrimaryKeyConstraint("chain_id", "token_address", "wallet_address"),
    )
    # ### end Alembic commands ###


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