-- 017_delivery_tmp_keys.sql
-- Extends recipient_uni_key to 48 chars and adds sender_uni_key.
-- These replace permanent keys in delivery email URLs.
-- Generated as crypto.randomBytes(24).toString('hex') = 48 hex chars.

ALTER TABLE customers
  ADD COLUMN IF NOT EXISTS sender_uni_key TEXT;

COMMENT ON COLUMN customers.recipient_uni_key IS 'Random 48-char delivery token for open.js URL. Nulled after download or expiry.';
COMMENT ON COLUMN customers.sender_uni_key    IS 'Random 48-char delivery token for open-sender.js URL. Nulled after download or expiry.';
