-- +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;