"""Add interview session resume relationship and timing fields

Revision ID: efeebe53c76c
Revises: 86cfa6ee73af
Create Date: 2025-09-09 00:13:58.304145

"""

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "efeebe53c76c"
down_revision: str | Sequence[str] | None = "86cfa6ee73af"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "interview_sessions",
        sa.Column("interview_start_time", sa.DateTime(), nullable=True),
    )
    op.add_column(
        "interview_sessions",
        sa.Column("interview_end_time", sa.DateTime(), nullable=True),
    )
    op.alter_column(
        "vacancy", "company_name", existing_type=sa.VARCHAR(length=255), nullable=True
    )
    op.alter_column(
        "vacancy", "area_name", existing_type=sa.VARCHAR(length=255), nullable=True
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "vacancy", "area_name", existing_type=sa.VARCHAR(length=255), nullable=False
    )
    op.alter_column(
        "vacancy", "company_name", existing_type=sa.VARCHAR(length=255), nullable=False
    )
    op.drop_column("interview_sessions", "interview_end_time")
    op.drop_column("interview_sessions", "interview_start_time")
    # ### end Alembic commands ###
