"""remove unnecessary compaction columns from wal file

Revision ID: 298875b23096
Revises: d77fb56536a8
Create Date: 2025-07-14 10:46:10.006756

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "298875b23096"
down_revision: Union[str, None] = "d77fb56536a8"
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.drop_column("wal_files", "compacted_by")
    op.drop_column("wal_files", "compacted")
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "wal_files",
        sa.Column("compacted", sa.BOOLEAN(), autoincrement=False, nullable=False),
    )
    op.add_column(
        "wal_files",
        sa.Column("compacted_by", sa.TEXT(), autoincrement=False, nullable=True),
    )
    # ### end Alembic commands ###
