-- Add nozzle_id to application plans
-- This allows linking nozzles to liquid application plans

ALTER TABLE application_plans 
ADD COLUMN IF NOT EXISTS nozzle_id INTEGER REFERENCES user_equipment(id);

-- Create index for better performance
CREATE INDEX IF NOT EXISTS idx_application_plans_nozzle ON application_plans(nozzle_id);

SELECT 'Added nozzle_id to application_plans table successfully!' as migration_status;