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

Add user table

This commit is contained in:
Gao Sun 2021-07-02 21:09:08 +08:00
parent 02a251b863
commit 68d67016ae
No known key found for this signature in database
GPG key ID: 0F0EFA2E36639F31
4 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,4 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export * from './oidc-model-instance';
export * from './user';

View file

@ -0,0 +1,22 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export type UserDBEntry = {
id: string;
userName?: string;
primaryEmail?: string;
primaryPhone?: string;
passwordEncrypted?: string;
passwordEncryptionMethod?: string;
};
export const Users = Object.freeze({
table: 'users',
fields: {
id: 'id',
userName: 'user_name',
primaryEmail: 'primary_email',
primaryPhone: 'primary_phone',
passwordEncrypted: 'password_encrypted',
passwordEncryptionMethod: 'password_encryption_method',
},
} as const);

View file

@ -45,7 +45,7 @@ const generate = async () => {
.map((value) => normalizeWhitespaces(value))
.filter((value) =>
['primary', 'foreign', 'unique', 'exclude', 'check'].every(
(constraint) => !value.startsWith(constraint)
(constraint) => !value.startsWith(constraint + ' ')
)
)
.map<Field>((value) => {

View file

@ -0,0 +1,9 @@
create table users (
id varchar(24) not null,
user_name varchar(128) unique,
primary_email varchar(128) unique,
primary_phone varchar(128) unique,
password_encrypted varchar(128),
password_encryption_method varchar(32),
primary key (id)
);