Serge Bazanski | a5baa87 | 2022-09-15 18:49:35 +0200 | [diff] [blame] | 1 | CREATE TABLE accounts ( |
| 2 | -- Internal account ID. Never changes. |
| 3 | account_id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY, |
| 4 | |
| 5 | -- Identity used to tied this account to OIDC. |
| 6 | -- OpenID Connect Core, 2. ID Token: “It MUST NOT exceed 255 ASCII |
| 7 | -- characters in length”. |
| 8 | account_oidc_sub STRING(255) NOT NULL UNIQUE, |
| 9 | |
| 10 | --- Copy/cache of user data retrieved from OIDC IdP on login. Currently this |
| 11 | --- is only updated on first login, but we should find a way to trigger |
| 12 | --- a re-retrieval. |
| 13 | -- Display name preferred by user. |
| 14 | -- Self-limiting ourselves to 255 unicode codepoints here. This is also |
| 15 | -- supposedly what keycloak also defaults to for user attributes. |
| 16 | account_display_name STRING(255) NOT NULL |
| 17 | ); |