fixed two old User Entity definitions. This is legit since this never changed and just was a missing definition. (Normally it would be forbidden to change old entity models or migrations)

This commit is contained in:
Ulf Gebhardt 2021-12-21 02:58:11 +01:00
parent cdd7d25024
commit 1f8d7b8230
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 34 additions and 10 deletions

View File

@ -2,7 +2,7 @@ import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'ty
import { Balance } from '../Balance'
// Moriz: I do not like the idea of having two user tables
@Entity('state_users')
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
export class User extends BaseEntity {
@PrimaryGeneratedColumn('increment', { unsigned: true })
id: number
@ -16,16 +16,28 @@ export class User extends BaseEntity {
@Column({ type: 'binary', length: 32, name: 'public_key' })
pubkey: Buffer
@Column({ length: 255, nullable: true, default: null })
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
email: string
@Column({ name: 'first_name', length: 255, nullable: true, default: null })
@Column({
name: 'first_name',
length: 255,
nullable: true,
default: null,
collation: 'utf8mb4_unicode_ci',
})
firstName: string
@Column({ name: 'last_name', length: 255, nullable: true, default: null })
@Column({
name: 'last_name',
length: 255,
nullable: true,
default: null,
collation: 'utf8mb4_unicode_ci',
})
lastName: string
@Column({ length: 255, nullable: true, default: null })
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
username: string
@Column()

View File

@ -2,7 +2,7 @@ import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToMany } from 't
import { UserSetting } from './UserSetting'
// Moriz: I do not like the idea of having two user tables
@Entity('state_users')
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
export class User extends BaseEntity {
@PrimaryGeneratedColumn('increment', { unsigned: true })
id: number
@ -16,16 +16,28 @@ export class User extends BaseEntity {
@Column({ type: 'binary', length: 32, name: 'public_key' })
pubkey: Buffer
@Column({ length: 255, nullable: true, default: null })
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
email: string
@Column({ name: 'first_name', length: 255, nullable: true, default: null })
@Column({
name: 'first_name',
length: 255,
nullable: true,
default: null,
collation: 'utf8mb4_unicode_ci',
})
firstName: string
@Column({ name: 'last_name', length: 255, nullable: true, default: null })
@Column({
name: 'last_name',
length: 255,
nullable: true,
default: null,
collation: 'utf8mb4_unicode_ci',
})
lastName: string
@Column({ length: 255, nullable: true, default: null })
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
username: string
@Column()