/ db / migrations / 129-block-sms-all-except-au-nz.sql
129-block-sms-all-except-au-nz.sql
 1  -- Migration 129: Disable SMS for all countries except AU and NZ
 2  --
 3  -- Legal compliance (DR-122, 2026-03-30):
 4  --   AU/NZ: Spam Act 2003 s.7(1)(b) / NZ UEMA 2007 — inferred consent from conspicuous publication
 5  --   US: TCPA — express written consent required, no B2B exemption; A2P 10DLC rejected (error 30909)
 6  --   CA: CASL — $10M CAD penalty; implied consent defence too narrow for cold SMS
 7  --   UK/IE: PECR — consent required for SMS to mobile numbers (corporate exemption doesn't apply in practice)
 8  --   ZA: POPIA — unclear consent basis, not worth the risk
 9  --   All others: no local legal basis for cold SMS
10  --
11  -- Reverses migrations 075 (enabled AU,NZ,CA,UK,US) and 077 (enabled US,IE).
12  -- The .env OUTREACH_BLOCKED_SMS_COUNTRIES provides a second layer of defence.
13  
14  UPDATE countries SET sms_enabled = false;
15  
16  UPDATE countries SET sms_enabled = true WHERE country_code IN ('AU', 'NZ');