-- Insert/update labeler definition
-- Parameters: $1=labeler_actor_id, $2=label_identifier, $3=severity, $4=blurs,
--             $5=default_setting, $6=adult_only, $7=locales
INSERT INTO labeler_defs (labeler_actor_id, label_identifier, severity, blurs, default_setting, adult_only, locales)
VALUES ($1, $2, $3::text::label_severity, $4::text::label_blurs, $5::text::label_default_setting, $6, $7)
ON CONFLICT (labeler_actor_id, label_identifier) DO UPDATE
    SET severity=EXCLUDED.severity,
        blurs=EXCLUDED.blurs,
        default_setting=EXCLUDED.default_setting,
        adult_only=EXCLUDED.adult_only,
        locales=EXCLUDED.locales
