mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-15 09:24:38 +00:00
updated model accordingly
This commit is contained in:
parent
0b0af7ae76
commit
a467c8d945
60
database/entity/0006-login_users_collation/LoginUser.ts
Normal file
60
database/entity/0006-login_users_collation/LoginUser.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'typeorm'
|
||||||
|
import { LoginUserBackup } from '../LoginUserBackup'
|
||||||
|
|
||||||
|
// Moriz: I do not like the idea of having two user tables
|
||||||
|
@Entity('login_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
||||||
|
export class LoginUser extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ length: 191, unique: true, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
email: string
|
||||||
|
|
||||||
|
@Column({ name: 'first_name', length: 150, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
firstName: string
|
||||||
|
|
||||||
|
@Column({ name: 'last_name', length: 255, default: '', collation: 'utf8mb4_unicode_ci' })
|
||||||
|
lastName: string
|
||||||
|
|
||||||
|
@Column({ length: 255, default: '', collation: 'utf8mb4_unicode_ci' })
|
||||||
|
username: string
|
||||||
|
|
||||||
|
@Column({ default: '', collation: 'utf8mb4_unicode_ci' })
|
||||||
|
description: string
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', default: 0, unsigned: true })
|
||||||
|
password: BigInt
|
||||||
|
|
||||||
|
@Column({ name: 'pubkey', type: 'binary', length: 32, default: null, nullable: true })
|
||||||
|
pubKey: Buffer
|
||||||
|
|
||||||
|
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
||||||
|
privKey: Buffer
|
||||||
|
|
||||||
|
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
||||||
|
emailHash: Buffer
|
||||||
|
|
||||||
|
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP' })
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@Column({ name: 'email_checked', default: 0 })
|
||||||
|
emailChecked: boolean
|
||||||
|
|
||||||
|
@Column({ name: 'passphrase_shown', default: 0 })
|
||||||
|
passphraseShown: boolean
|
||||||
|
|
||||||
|
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci' })
|
||||||
|
language: string
|
||||||
|
|
||||||
|
@Column({ default: 0 })
|
||||||
|
disabled: boolean
|
||||||
|
|
||||||
|
@Column({ name: 'group_id', default: 0, unsigned: true })
|
||||||
|
groupId: number
|
||||||
|
|
||||||
|
@Column({ name: 'publisher_id', default: 0 })
|
||||||
|
publisherId: number
|
||||||
|
|
||||||
|
@OneToOne(() => LoginUserBackup, (loginUserBackup) => loginUserBackup.loginUser)
|
||||||
|
loginUserBackup: LoginUserBackup
|
||||||
|
}
|
||||||
@ -1 +1 @@
|
|||||||
export { LoginUser } from './0003-login_server_tables/LoginUser'
|
export { LoginUser } from './0006-login_users_collation/LoginUser'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user