"""add priority_score specialty to global_journals

Revision ID: 9e0f7def15ee
Revises: dcf00fe7055b
Create Date: 2026-07-15 08:42:02.367754
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa


revision: str = '9e0f7def15ee'
down_revision: Union[str, None] = 'dcf00fe7055b'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column('global_journals', sa.Column('priority_score', sa.Float(), nullable=True))
    op.add_column('global_journals', sa.Column('priority_source', sa.String(length=20), nullable=True))
    op.add_column('global_journals', sa.Column('specialty', sa.String(length=50), nullable=True))
    op.create_index('ix_gj_priority', 'global_journals', ['priority_score'], unique=False, postgresql_using='btree')


def downgrade() -> None:
    op.drop_index('ix_gj_priority', table_name='global_journals', postgresql_using='btree')
    op.drop_column('global_journals', 'specialty')
    op.drop_column('global_journals', 'priority_source')
    op.drop_column('global_journals', 'priority_score')
