Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / db/migrations/0079_user_profile_fields.sql |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | db/migrations/0079_user_profile_fields.sql |
| Original SHA-256 | 847409b3e21b2306340e7b49a9c1f7a5ae42f57cc75104ddd060afc669f8b4d1 |
| Git blob SHA | 3b1e063c1c3f306f1f4731fb5ba14c7e7feec6d4 |
| Reading-copy SHA-256 | 847409b3e21b2306340e7b49a9c1f7a5ae42f57cc75104ddd060afc669f8b4d1 |
Recovered source transcript
Download complete source text ↓29 lines · 1.7 KB
-- +goose Up
-- Self service profile fields, amendment 6 decision 4 and Track U item 2. A user may edit their own display
-- name, title, and phone. The name already exists as full_name, which is the column this amendment's
-- display name wording maps onto (ratified 28 July 2026); title and phone do not exist yet and are added
-- here. Both are optional free text with a length cap, defaulting to empty so every existing row stays
-- valid without a backfill.
--
-- Why this is a schema change at all: the reported defect was that a client top seat could not edit her own
-- name, and the root cause was that NO code path writes full_name after invite acceptance. Adding the two
-- missing columns alongside the write path keeps profile editing one feature rather than a name fix now and
-- a title and phone fix later.
ALTER TABLE users ADD COLUMN IF NOT EXISTS title text NOT NULL DEFAULT '';
ALTER TABLE users ADD COLUMN IF NOT EXISTS phone text NOT NULL DEFAULT '';
-- Caps rather than unbounded text: a profile field is a label, not a document, and an unbounded field on an
-- identity row is a free storage channel on a table every request reads.
ALTER TABLE users ADD CONSTRAINT ck_users_title_len CHECK (length(title) <= 120);
ALTER TABLE users ADD CONSTRAINT ck_users_phone_len CHECK (length(phone) <= 40);
-- The app role already holds UPDATE on users for status and role changes; profile editing reuses it. No new
-- grant is needed, and none is given.
-- +goose Down
ALTER TABLE users DROP CONSTRAINT IF EXISTS ck_users_phone_len;
ALTER TABLE users DROP CONSTRAINT IF EXISTS ck_users_title_len;
ALTER TABLE users DROP COLUMN IF EXISTS phone;
ALTER TABLE users DROP COLUMN IF EXISTS title;