Files
orca/cloud/apps/sandbox-control/migrations/0037_member_changes.sql
T
Neil e998a5ce96 W8 follow-ups: removal and role loss reach phones; role-aware plan-denial copy (#135)
* fix(w8): removing a member revokes their phones; role changes move phones too; a phone's stored role never re-syncs keys

* fix(w8): one removal path revokes keys, phones, grants and routines; stale desktop tokens can't re-sync roles or vouch phones; a grant revoked mid-issue stays revoked

* fix(w8): a removed member's unexpired desktop tokens stop working; changes count from auth's time; desktop re-mints and retries enroll on stale_token

* feat(w8): role-aware plan-denial copy on the phone (owners and admins get the fix, members who to ask)

* fix(w8): W10 copy (per-seat team limit, choose a plan) and FE review (3 s abortable role read, Android live region, more copy cases); no casts
2026-11-09 18:02:56 -08:00

11 lines
460 B
SQL

-- When auth last told us a member's role changed or they left an account. A desktop token issued
-- at or before that moment carries a stale role or membership, so it may not re-sync key roles or
-- enroll (or re-vouch) a phone. Additive; one row per (account, member).
CREATE TABLE IF NOT EXISTS member_changes (
account_id TEXT NOT NULL,
user_id TEXT NOT NULL,
changed_at INTEGER NOT NULL,
removed_at INTEGER,
PRIMARY KEY (account_id, user_id)
);