0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00
logto/packages/schemas/tables/users.sql
IceHe.xyz 4521c3c8d1
feat(core,schemas): save application id that the user first consented (#688)
* feat(core,schemas): save application id which the user first consented

* chore(core): fix grammatical mistake and typos
2022-05-05 06:57:20 +00:00

18 lines
708 B
SQL

create type users_password_encryption_method as enum ('SaltAndPepper');
create table users (
id varchar(12) not null,
username varchar(128) unique,
primary_email varchar(128) unique,
primary_phone varchar(128) unique,
password_encrypted varchar(128),
password_encryption_method users_password_encryption_method,
password_encryption_salt varchar(128),
name varchar(128),
avatar varchar(256),
application_id varchar(21) references applications(id),
role_names jsonb /* @use RoleNames */ not null default '[]'::jsonb,
identities jsonb /* @use Identities */ not null default '{}'::jsonb,
custom_data jsonb /* @use ArbitraryObject */ not null default '{}'::jsonb,
primary key (id)
);