UPDATE template
SET template_type = CASE
    WHEN UPPER(template_type) LIKE '%AGENDA%' THEN 'AGENDA'
    WHEN UPPER(template_type) LIKE '%SIGN%' THEN 'SIGN_IN'
    WHEN UPPER(template_type) LIKE '%INVIT%' THEN 'INVITATION'
    WHEN UPPER(template_type) = 'SIGN' THEN 'SIGN_IN'
    WHEN UPPER(template_type) IN ('INVIT', 'INVITATION_LETTER') THEN 'INVITATION'
    WHEN UPPER(template_type) IN ('AGENDA', 'SIGN_IN', 'INVITATION', 'OTHER') THEN UPPER(template_type)
    ELSE 'OTHER'
END
WHERE tenant_id = 1;
