-- liquibase formatted sql
-- changeset Enson:update_bom_type_by_code_and_isDrink_20260408

UPDATE `fpsmsdb`.`bom`
SET `type` = CASE
    WHEN isDrink = 1 THEN 'Drink'
    WHEN code IN (
        'PP2255','PP2257','PP2258','PP2259','PP2261','PP2263','PP2264','PP2266',
        'PP2270','PP2275','PP2280','PP2281','PP2283',
        'PP2291','PP2295','PP2296','PP2297','PP2299','PP2302','PP2303','PP2304',
        'PP2305','PP2339','PP2340'
    ) THEN 'Powder_Mixture'
    ELSE 'Other'
END
WHERE `type` IS NULL OR `type` = '';