"""2844cd1

Revision ID: 9e5bf78cb866
Revises:
Create Date: 2025-04-22 12:08:52.640110

"""

from typing import Sequence, Union

import sqlalchemy as sa
import sqlmodel.sql.sqltypes

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "9e5bf78cb866"
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "jobquery",
        sa.Column("query", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("locations", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("games_only", sa.Boolean(), nullable=False),
        sa.Column("remote_only", sa.Boolean(), nullable=False),
        sa.Column(
            "experience",
            sa.Enum(
                "INTERNSHIP",
                "ENTRY_LEVEL",
                "ASSOCIATE",
                "MID_SENIOR",
                "DIRECTOR",
                "EXECUTIVE",
                name="experiencelevelfilters",
            ),
            nullable=False,
        ),
        sa.Column("creator_discord_id", sa.Integer(), nullable=False),
        sa.Column("creation_date", sa.DateTime(), nullable=False),
        sa.Column("id", sa.Uuid(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "job",
        sa.Column("job_id", sa.Integer(), nullable=False),
        sa.Column("location", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("link", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("apply_link", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("title", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("company", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("company_link", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("company_img_link", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("place", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("description_html", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("date", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("date_text", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("job_query_id", sa.Uuid(), nullable=True),
        sa.ForeignKeyConstraint(
            ["job_query_id"],
            ["jobquery.id"],
        ),
        sa.PrimaryKeyConstraint("job_id"),
    )
    # ### end Alembic commands ###


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