blob: 4812e0004c29c72740b4d6e0d7d057328398444b [file] [log] [blame]
Serge Bazanskia5baa872022-09-15 18:49:35 +02001CREATE 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);