0011_api_key_role.sql11 lines · main
| 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 | |
| 7 | BEGIN; |
| 8 | |
| 9 | ALTER TABLE "api_keys" ADD COLUMN "role" text DEFAULT 'admin' NOT NULL; |
| 10 | |
| 11 | COMMIT; |