patch.sql
Transactional, UPSERT-only SQL
Wrapped in BEGIN / COMMIT. UPSERT-based so re-applying is safe. A failure mid-apply rolls back; your previous version remains intact.
-- patch.sql — applied in a single PostgreSQL transaction
BEGIN;
-- Add a newly prohibited substance (Annex II, position 1.629)
INSERT INTO cosing_substances (
cosing_ref, inci_name, cas_number, einecs_number, annex, position, updated_at
) VALUES (
'COS-93412', 'Butylphenyl Methylpropional', '80-54-6', '201-289-8',
'II', 1629, '2026-05-12T08:00:00Z'
)
ON CONFLICT (cosing_ref) DO UPDATE
SET annex = EXCLUDED.annex,
position = EXCLUDED.position,
updated_at = EXCLUDED.updated_at;
-- Update an existing Annex III restriction (max concentration in leave-on)
UPDATE cosing_substances
SET restriction_max_concentration_leave_on = '0.0015',
updated_at = '2026-05-12T08:00:00Z'
WHERE cosing_ref = 'COS-31207';
COMMIT;