"""add project reset day

Revision ID: b7e21a94f5c8
Revises: c85fda110379
Create Date: 2026-07-20 09:00:00.000000

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'b7e21a94f5c8'
down_revision: Union[str, Sequence[str], None] = 'c85fda110379'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    with op.batch_alter_table('project') as batch_op:
        batch_op.add_column(
            sa.Column('reset_day', sa.Integer(), nullable=False, server_default='0')
        )
        batch_op.add_column(sa.Column('last_reset_at', sa.Date(), nullable=True))


def downgrade() -> None:
    """Downgrade schema."""
    with op.batch_alter_table('project') as batch_op:
        batch_op.drop_column('last_reset_at')
        batch_op.drop_column('reset_day')
