-- Add Inspection machine type and update 06xx machines
-- Date: 2026-02-03
-- Purpose: Create Inspection machine type for 0612-0615 machines so they
--          appear on displaymachines.asp (previously hidden as LocationOnly)

-- 1. Add Inspection machine type
INSERT INTO machinetypes (machinetypeid, machinetype) VALUES (47, 'Inspection');

-- 2. Create Inspection model (linked to new type, default vendor WJDT)
INSERT INTO models (modelnumber, vendorid, machinetypeid, isactive)
VALUES ('Inspection', 1, 47, 1);

-- 3. Update machines 0612-0615 to use the new Inspection model
UPDATE machines
SET modelnumberid = (SELECT modelnumberid FROM models WHERE modelnumber = 'Inspection' AND machinetypeid = 47 LIMIT 1)
WHERE machinenumber IN ('0612', '0613', '0614', '0615');

-- 4. Enable WJDT vendor in machine edit model dropdown
UPDATE vendors SET ismachine = 1 WHERE vendorid = 1;
