Charge ceil(len/64)*400 IRT per recipient across OTP, customer, and partner SMS; seed new businesses with 500k IRT; default partner sends to the advertising line. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
732 B
SQL
22 lines
732 B
SQL
-- SMS template verification workflow: free | pending | verified
|
|
|
|
ALTER TABLE sms_templates
|
|
ADD COLUMN IF NOT EXISTS verification_status VARCHAR(32) NOT NULL DEFAULT 'free';
|
|
|
|
UPDATE sms_templates
|
|
SET verification_status = 'verified'
|
|
WHERE is_verified = TRUE;
|
|
|
|
ALTER TABLE sms_templates
|
|
DROP CONSTRAINT IF EXISTS sms_templates_verification_status_check;
|
|
|
|
ALTER TABLE sms_templates
|
|
ADD CONSTRAINT sms_templates_verification_status_check
|
|
CHECK (verification_status IN ('free', 'pending', 'verified'));
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_sms_templates_verification_status
|
|
ON sms_templates (verification_status);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_sms_templates_business_status
|
|
ON sms_templates (business_id, verification_status);
|