-- A manager, and the refresh token it holds encrypted at rest. -- -- novox/hq ADR 0050, Phase B. The consolidated schema (0001) now creates the `manager` column and -- the `refresh_grant` table; this migration carries an existing database the same distance, so a -- database that predates the carve-out gains exactly what a fresh one is created with. -- -- **Guarded, so it is a no-op on a database created after 0001 was updated.** A fresh database -- already has both, and re-adding them would fail; `if not exists` on both makes the two paths -- -- fresh and pre-existing -- end at the same schema. alter table licence add column if not exists manager text; create table if not exists refresh_grant ( licence text primary key references licence(name) on delete cascade, token text not null, wrapped_key text not null, manager_key text not null, updated_at timestamptz not null default now() );