Files
redefined-designs/backend/migrations/1787700000000_add-upload-link-contact-email.js
T
bermudalambandClaude Opus 5 eaecc43379 feat(intake): record where an upload link was sent, and how to say it (#260)
Adds upload_links.contact_email and the uploadLink mail template.

The column is nullable on purpose. Links already exist in QA and a migration cannot invent addresses for them, so they are grandfathered rather than backfilled with something untrue; the requirement belongs in the create route, which is where new links are actually made.

The template requires submitUrl, the same guard verification has on verifyUrl. An email inviting somebody to send in photos, with no way for them to do it, sends perfectly happily and looks fine in the log — it is the one failure here worth making impossible, and a test asserts the default body satisfies the guard it declares.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-03 17:50:11 -05:00

18 lines
680 B
JavaScript

exports.up = (pgm) => {
pgm.sql(`
-- Where the link was sent (#260). Nullable, and deliberately so: links
-- already exist in QA and a migration cannot invent an address for them, so
-- they are grandfathered rather than backfilled with something untrue.
--
-- The requirement lives in the create route instead, which is where new
-- links are actually made. A NOT NULL column would have forced a choice
-- between inventing data and refusing to migrate.
ALTER TABLE upload_links
ADD COLUMN IF NOT EXISTS contact_email TEXT;
`);
};
exports.down = (pgm) => {
pgm.sql(`ALTER TABLE upload_links DROP COLUMN IF EXISTS contact_email;`);
};