0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/schemas/tables/users.sql

19 lines
692 B
MySQL
Raw Normal View History

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 (
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),
password_encryption_method users_password_encryption_method,
name varchar(128),
avatar varchar(256),
application_id varchar(21) references applications(id),
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,
custom_data jsonb /* @use ArbitraryObject */ not null default '{}'::jsonb,
last_sign_in_at timestamptz,
2021-07-02 08:09:08 -05:00
primary key (id)
);