-- 018_recipient_downloaded_at.sql
--
-- Adds recipient_downloaded_at timestamp for audit trail.
-- Previously recipient_uni_key was nulled after download — this loses the audit trail.
-- Now we keep recipient_uni_key intact and use recipient_downloaded_at to mark as used.

ALTER TABLE customers
  ADD COLUMN IF NOT EXISTS recipient_downloaded_at TIMESTAMP WITH TIME ZONE;

COMMENT ON COLUMN customers.recipient_downloaded_at IS 'When recipient downloaded their postcard copy. NULL = not yet downloaded.';
