-- Migration: Add qty field to planning_job table
-- Date: 2026-01-22
-- Purpose: Store product quantity for duration calculation (qty/qty_per_hour)

ALTER TABLE llx_planning_job ADD COLUMN qty DECIMAL(10,2) NOT NULL DEFAULT 1.00 AFTER estimated_hours;

-- Ensure all existing jobs have qty = 1.00 (already set via DEFAULT, but explicit for clarity)
UPDATE llx_planning_job SET qty = 1.00 WHERE qty IS NULL OR qty = 0;
