mirror of
https://github.com/immich-app/immich.git
synced 2026-03-11 12:47:36 +03:00
* refactor: user repository * refactor: user module * refactor: move database into infra * refactor(cli): use user core * chore: import path * chore: tests
42 lines
841 B
TypeScript
42 lines
841 B
TypeScript
import { Column, CreateDateColumn, DeleteDateColumn, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { TagEntity } from './tag.entity';
|
|
|
|
@Entity('users')
|
|
export class UserEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id!: string;
|
|
|
|
@Column({ default: '' })
|
|
firstName!: string;
|
|
|
|
@Column({ default: '' })
|
|
lastName!: string;
|
|
|
|
@Column({ default: false })
|
|
isAdmin!: boolean;
|
|
|
|
@Column({ unique: true })
|
|
email!: string;
|
|
|
|
@Column({ default: '', select: false })
|
|
password?: string;
|
|
|
|
@Column({ default: '' })
|
|
oauthId!: string;
|
|
|
|
@Column({ default: '' })
|
|
profileImagePath!: string;
|
|
|
|
@Column({ default: true })
|
|
shouldChangePassword!: boolean;
|
|
|
|
@CreateDateColumn()
|
|
createdAt!: string;
|
|
|
|
@DeleteDateColumn()
|
|
deletedAt?: Date;
|
|
|
|
@OneToMany(() => TagEntity, (tag) => tag.user)
|
|
tags!: TagEntity[];
|
|
}
|