0011_api_key_role.sql 434 B

1234567891011
  1. -- Add `role` column to `api_keys` so each key carries an effective role
  2. -- (viewer / developer / admin). Defaults to 'admin' so keys minted before
  3. -- this migration keep their previous full-power semantics; new keys can
  4. -- be issued at any standard role at creation time. 'owner' is never
  5. -- assignable to a key — reserved for human owners.
  6. BEGIN;
  7. ALTER TABLE "api_keys" ADD COLUMN "role" text DEFAULT 'admin' NOT NULL;
  8. COMMIT;