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:
parent
02a251b863
commit
68d67016ae
4 changed files with 33 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
export * from './oidc-model-instance';
|
||||
export * from './user';
|
||||
|
|
22
packages/schemas/src/db-entries/user.ts
Normal file
22
packages/schemas/src/db-entries/user.ts
Normal 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);
|
|
@ -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) => {
|
||||
|
|
9
packages/schemas/tables/users.sql
Normal file
9
packages/schemas/tables/users.sql
Normal 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)
|
||||
);
|
Loading…
Reference in a new issue