-- Add production_order_id to packing_orders for traceability
ALTER TABLE packing_orders
  ADD COLUMN production_order_id int unsigned DEFAULT NULL AFTER style_id,
  ADD KEY idx_production_order (production_order_id);

-- Add batch/lot tracking to bom_consumption
ALTER TABLE bom_consumption
  ADD COLUMN batch_no varchar(50) DEFAULT NULL AFTER uom,
  ADD COLUMN lot_no varchar(50) DEFAULT NULL AFTER batch_no;

-- Add batch/lot tracking to production_order_materials
ALTER TABLE production_order_materials
  ADD COLUMN batch_no varchar(50) DEFAULT NULL AFTER consumed_qty,
  ADD COLUMN lot_no varchar(50) DEFAULT NULL AFTER batch_no;
