"""Make HistoryUnit.logfile required

Revision ID: f37aceb45062
Revises: 9db60297b8b2
Create Date: 2025-04-14 13:49:40.910342

"""
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = "f37aceb45062"
down_revision = "9db60297b8b2"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("historyunit", schema=None) as batch_op:
        batch_op.alter_column(
            "logfile",
            existing_type=sa.VARCHAR(),
            nullable=False,
            server_default="__LOGFILE_PLACEHOLDER__",
        )

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("historyunit", schema=None) as batch_op:
        batch_op.alter_column(
            "logfile", existing_type=sa.VARCHAR(), nullable=True
        )

    # ### end Alembic commands ###
