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