-- Add PR traceability columns to procurement_order_items
-- This allows tracking which Purchase Requisition item each PO item came from

ALTER TABLE procurement_order_items
  ADD COLUMN pr_id INT UNSIGNED NULL AFTER po_id,
  ADD COLUMN pr_item_id INT UNSIGNED NULL AFTER pr_id,
  ADD INDEX idx_pr_id (pr_id),
  ADD INDEX idx_pr_item_id (pr_item_id);
