"""Remove partner_id from receipts - supplier data is text-only

Revision ID: 20251215_remove_partner_id
Revises: 20251216_payment_mode
Create Date: 2025-12-15

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '20251215_remove_partner_id'
down_revision: Union[str, None] = '20251216_payment_mode'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Remove partner_id column - supplier data is now text-only (partner_name, cui)."""
    # Drop the partner_id column
    op.drop_column('receipts', 'partner_id')


def downgrade() -> None:
    """Re-add partner_id column."""
    op.add_column('receipts', sa.Column('partner_id', sa.Integer(), nullable=True))
