2023-05-17 19:07:17 +02:00
|
|
|
import {
|
|
|
|
Column,
|
|
|
|
CreateDateColumn,
|
|
|
|
Entity,
|
|
|
|
ManyToOne,
|
|
|
|
OneToMany,
|
|
|
|
PrimaryGeneratedColumn,
|
|
|
|
UpdateDateColumn,
|
|
|
|
} from 'typeorm';
|
|
|
|
import { AssetFaceEntity } from './asset-face.entity';
|
|
|
|
import { UserEntity } from './user.entity';
|
|
|
|
|
|
|
|
@Entity('person')
|
|
|
|
export class PersonEntity {
|
|
|
|
@PrimaryGeneratedColumn('uuid')
|
|
|
|
id!: string;
|
|
|
|
|
|
|
|
@CreateDateColumn({ type: 'timestamptz' })
|
|
|
|
createdAt!: Date;
|
|
|
|
|
|
|
|
@UpdateDateColumn({ type: 'timestamptz' })
|
|
|
|
updatedAt!: Date;
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
ownerId!: string;
|
|
|
|
|
|
|
|
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false })
|
|
|
|
owner!: UserEntity;
|
|
|
|
|
|
|
|
@Column({ default: '' })
|
|
|
|
name!: string;
|
|
|
|
|
|
|
|
@Column({ default: '' })
|
|
|
|
thumbnailPath!: string;
|
|
|
|
|
|
|
|
@OneToMany(() => AssetFaceEntity, (assetFace) => assetFace.person)
|
|
|
|
faces!: AssetFaceEntity[];
|
2023-07-18 20:09:43 +02:00
|
|
|
|
|
|
|
@Column({ default: false })
|
|
|
|
isHidden!: boolean;
|
2023-05-17 19:07:17 +02:00
|
|
|
}
|