"""add PubMed enrichment fields (ChemicalList, GeneSymbolList, etc.) to global_literature

Revision ID: a7b8c9d0e1f2
Revises: 8c468ef8b9fa
Create Date: 2026-07-10 11:00:00.000000
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa


revision: str = 'a7b8c9d0e1f2'
down_revision: Union[str, None] = '8c468ef8b9fa'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column('global_literature', sa.Column('chemical_list', sa.JSON(), nullable=True))
    op.add_column('global_literature', sa.Column('gene_symbols', sa.JSON(), nullable=True))
    op.add_column('global_literature', sa.Column('num_refs', sa.Integer(), nullable=True))
    op.add_column('global_literature', sa.Column('publication_status', sa.String(30), nullable=True))
    op.add_column('global_literature', sa.Column('article_date', sa.Date(), nullable=True))
    op.add_column('global_literature', sa.Column('databank_list', sa.JSON(), nullable=True))
    op.add_column('global_literature', sa.Column('suppl_mesh_list', sa.JSON(), nullable=True))


def downgrade() -> None:
    op.drop_column('global_literature', 'suppl_mesh_list')
    op.drop_column('global_literature', 'databank_list')
    op.drop_column('global_literature', 'article_date')
    op.drop_column('global_literature', 'publication_status')
    op.drop_column('global_literature', 'num_refs')
    op.drop_column('global_literature', 'gene_symbols')
    op.drop_column('global_literature', 'chemical_list')
