"""Sales Projection: Closing (quantity, value) and Projection (quantity, value) The form is now Sl. No. | Product | PTS | Closing (Qty, Value) | Projection (Qty, Value). The old Closing figure becomes the closing quantity. The other old columns (Sec. Qty, Value, Sec. Value, Sales, Value) are no longer shown, but are kept so no entered figure is lost. Revision ID: q7a3c9e5f2b4 Revises: p6f2b8d4e1a3 Create Date: 2026-10-26 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "q7a3c9e5f2b4" down_revision: str | None = "p6f2b8d4e1a3" branch_labels: str | Sequence[str] | None = None depends_on: str | Sequence[str] | None = None COLUMNS = ("closing_qty", "closing_value", "projection_qty", "projection_value") def upgrade() -> None: for column in COLUMNS: op.add_column("sales_projection", sa.Column(column, sa.Text(), nullable=True)) op.execute('UPDATE "sales_projection" SET closing_qty = closing') def downgrade() -> None: for column in reversed(COLUMNS): op.drop_column("sales_projection", column)