-- ============================================================================
-- Migration: Add Specialized PC Machine Types
-- Date: 2025-12-03
-- Purpose: Add PC types for CMM, Wax Trace, and Measuring Tool PCs
--
-- These PC types allow categorization of PCs based on installed software:
--   - PC - CMM: PCs running PC-DMIS for CMM measurement
--   - PC - Wax Trace: PCs running Formtracepak for wax trace inspection
--   - PC - Measuring Tool: PCs running Keyence/Genspect for measurement
--
-- This enables proper PC-to-Equipment relationships:
--   - PC - CMM (41) <-> CMM equipment (machinetypeid 3)
--   - PC - Wax Trace (42) <-> Wax Trace equipment (machinetypeid 5)
--   - PC - Measuring Tool (43) <-> Measuring Machine equipment (machinetypeid 23)
-- ============================================================================

-- Add new specialized PC machine types
INSERT INTO machinetypes (machinetypeid, machinetype, isactive, functionalaccountid, bgcolor, machinedescription)
VALUES
    (41, 'PC - CMM', 1, NULL, NULL, 'PC running PC-DMIS for CMM measurement'),
    (42, 'PC - Wax Trace', 1, NULL, NULL, 'PC running Formtracepak for wax trace inspection'),
    (43, 'PC - Measuring Tool', 1, NULL, NULL, 'PC running Keyence/Genspect for measurement')
ON DUPLICATE KEY UPDATE
    machinetype = VALUES(machinetype),
    machinedescription = VALUES(machinedescription),
    isactive = 1;

-- Verify the changes
SELECT machinetypeid, machinetype, machinedescription, isactive
FROM machinetypes
WHERE machinetypeid IN (41, 42, 43)
ORDER BY machinetypeid;
