"""initial

Revision ID: a694f7c9e766
Revises:
Create Date: 2025-08-30 19:48:53.070679

"""

from collections.abc import Sequence

import sqlalchemy as sa
import sqlmodel
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "a694f7c9e766"
down_revision: str | Sequence[str] | None = None
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.create_table(
        "vacancy",
        sa.Column(
            "title", sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False
        ),
        sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("key_skills", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column(
            "employment_type",
            sa.Enum(
                "FULL_TIME",
                "PART_TIME",
                "PROJECT",
                "VOLUNTEER",
                "PROBATION",
                name="employmenttype",
            ),
            nullable=False,
        ),
        sa.Column(
            "experience",
            sa.Enum(
                "NO_EXPERIENCE",
                "BETWEEN_1_AND_3",
                "BETWEEN_3_AND_6",
                "MORE_THAN_6",
                name="experience",
            ),
            nullable=False,
        ),
        sa.Column(
            "schedule",
            sa.Enum(
                "FULL_DAY",
                "SHIFT",
                "FLEXIBLE",
                "REMOTE",
                "FLY_IN_FLY_OUT",
                name="schedule",
            ),
            nullable=False,
        ),
        sa.Column("salary_from", sa.Integer(), nullable=True),
        sa.Column("salary_to", sa.Integer(), nullable=True),
        sa.Column(
            "salary_currency", sqlmodel.sql.sqltypes.AutoString(length=3), nullable=True
        ),
        sa.Column("gross_salary", sa.Boolean(), nullable=True),
        sa.Column(
            "company_name", sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False
        ),
        sa.Column(
            "company_description", sqlmodel.sql.sqltypes.AutoString(), nullable=True
        ),
        sa.Column(
            "area_name", sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False
        ),
        sa.Column("metro_stations", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("address", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column(
            "professional_roles", sqlmodel.sql.sqltypes.AutoString(), nullable=True
        ),
        sa.Column(
            "contacts_name", sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True
        ),
        sa.Column(
            "contacts_email",
            sqlmodel.sql.sqltypes.AutoString(length=255),
            nullable=True,
        ),
        sa.Column(
            "contacts_phone", sqlmodel.sql.sqltypes.AutoString(length=50), nullable=True
        ),
        sa.Column("is_archived", sa.Boolean(), nullable=False),
        sa.Column("premium", sa.Boolean(), nullable=False),
        sa.Column("published_at", sa.DateTime(), nullable=True),
        sa.Column("url", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "resume",
        sa.Column("vacancy_id", sa.Integer(), nullable=False),
        sa.Column(
            "applicant_name",
            sqlmodel.sql.sqltypes.AutoString(length=255),
            nullable=False,
        ),
        sa.Column(
            "applicant_email",
            sqlmodel.sql.sqltypes.AutoString(length=255),
            nullable=False,
        ),
        sa.Column(
            "applicant_phone",
            sqlmodel.sql.sqltypes.AutoString(length=50),
            nullable=True,
        ),
        sa.Column(
            "resume_file_url", sqlmodel.sql.sqltypes.AutoString(), nullable=False
        ),
        sa.Column("cover_letter", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column(
            "status",
            sa.Enum(
                "PENDING",
                "UNDER_REVIEW",
                "INTERVIEW_SCHEDULED",
                "INTERVIEWED",
                "REJECTED",
                "ACCEPTED",
                name="resumestatus",
            ),
            nullable=False,
        ),
        sa.Column(
            "interview_report_url", sqlmodel.sql.sqltypes.AutoString(), nullable=True
        ),
        sa.Column("notes", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(
            ["vacancy_id"],
            ["vacancy.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("resume")
    op.drop_table("vacancy")
    # ### end Alembic commands ###
