2022-05-06 16:38:38 +08:00
|
|
|
create type users_password_encryption_method as enum ('Argon2i');
|
2021-07-03 19:13:05 +08:00
|
|
|
|
2021-07-02 21:09:08 +08:00
|
|
|
create table users (
|
2022-04-18 15:27:58 +08:00
|
|
|
id varchar(12) not null,
|
2021-07-04 17:38:37 +08:00
|
|
|
username varchar(128) unique,
|
2021-07-02 21:09:08 +08:00
|
|
|
primary_email varchar(128) unique,
|
|
|
|
primary_phone varchar(128) unique,
|
|
|
|
password_encrypted varchar(128),
|
2022-02-24 18:01:17 +08:00
|
|
|
password_encryption_method users_password_encryption_method,
|
2022-02-14 16:03:13 +08:00
|
|
|
name varchar(128),
|
2022-06-17 17:04:04 +08:00
|
|
|
avatar varchar(2048),
|
2022-05-26 17:44:32 +08:00
|
|
|
application_id varchar(21),
|
2022-01-28 13:33:57 +08:00
|
|
|
role_names jsonb /* @use RoleNames */ not null default '[]'::jsonb,
|
2022-02-09 12:55:06 +08:00
|
|
|
identities jsonb /* @use Identities */ not null default '{}'::jsonb,
|
2022-02-28 11:22:48 +08:00
|
|
|
custom_data jsonb /* @use ArbitraryObject */ not null default '{}'::jsonb,
|
2022-05-05 16:22:43 +08:00
|
|
|
last_sign_in_at timestamptz,
|
2021-07-02 21:09:08 +08:00
|
|
|
primary key (id)
|
|
|
|
);
|