"""add is_done field to the task model

Revision ID: ca28796a2a62
Revises: 971dbf5a0faf
Create Date: 2024-07-19 15:24:21.064991

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "ca28796a2a62"
down_revision = "971dbf5a0faf"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("notification", schema=None) as batch_op:
        batch_op.alter_column(
            "type", existing_type=sa.VARCHAR(length=255), nullable=False
        )

    with op.batch_alter_table("task", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column("done_date", sa.DateTime(), nullable=True)
        )

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("task", schema=None) as batch_op:
        batch_op.drop_column("done_date")

    with op.batch_alter_table("notification", schema=None) as batch_op:
        batch_op.alter_column(
            "type", existing_type=sa.VARCHAR(length=255), nullable=True
        )

    # ### end Alembic commands ###
