2022-02-24 18:01:17 +08:00
|
|
|
create type users_password_encryption_method as enum ('SaltAndPepper');
|
2021-07-03 19:13:05 +08:00
|
|
|
|
2021-07-02 21:09:08 +08:00
|
|
|
create table users (
|
|
|
|
id varchar(24) 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,
|
2021-07-03 17:44:03 +08:00
|
|
|
password_encryption_salt varchar(128),
|
2022-02-14 16:03:13 +08:00
|
|
|
name varchar(128),
|
|
|
|
avatar varchar(256),
|
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,
|
2021-07-02 21:09:08 +08:00
|
|
|
primary key (id)
|
|
|
|
);
|