"""empty message

Revision ID: 9a32674539dd
Revises: 892aba57b356
Create Date: 2025-11-23 01:26:29.515334

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
import pgvector.sqlalchemy
from sqlalchemy import Text
from sqlalchemy.dialects.postgresql import JSONB, UUID
import template_project.adapters.data_gateways.tables
from template_project.adapters.data_gateways.tables import StringArrayType


# revision identifiers, used by Alembic.
revision: str = '9a32674539dd'
down_revision: Union[str, Sequence[str], None] = '892aba57b356'
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('vacancy',
    sa.Column('id', sa.UUID(), nullable=False),
    sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
    sa.Column('position', sa.String(), nullable=False),
    sa.Column('from_salary', sa.Numeric(), nullable=False),
    sa.Column('to_salary', sa.Numeric(), nullable=False),
    sa.Column('experience_type', sa.String(), nullable=False),
    sa.Column('description', sa.String(), nullable=False),
    sa.Column('key_skills', template_project.adapters.data_gateways.tables.StringArrayType(astext_type=Text()), server_default=sa.text("'[]'::jsonb"), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('vacancy_embedding',
    sa.Column('id', sa.UUID(), nullable=False),
    sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
    sa.Column('vacancy_id', sa.UUID(), nullable=False),
    sa.Column('vector', pgvector.sqlalchemy.vector.VECTOR(), nullable=False),
    sa.ForeignKeyConstraint(['vacancy_id'], ['vacancy.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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