mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* feat: un-assign people * regenerate api * edit migration script * fix: tests * fix: typeorm * fix: typo * fix: type * fix: migration * fix: update * fix: contraints * fix: remove set * feat: add assetId * remove assetId * remove unassignedFaces * fix: migration * regenerate api * fix: tests * remove changes to the api * fix: migration * fix migration * pr feedback * fix: revert change * fix: tests --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { AssetEntity } from './asset.entity';
|
|
import { PersonEntity } from './person.entity';
|
|
|
|
@Entity('asset_faces')
|
|
export class AssetFaceEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id!: string;
|
|
|
|
@Column()
|
|
assetId!: string;
|
|
|
|
@Column({ nullable: true, type: 'uuid' })
|
|
personId!: string | null;
|
|
|
|
@Column({
|
|
type: 'float4',
|
|
array: true,
|
|
nullable: true,
|
|
})
|
|
embedding!: number[] | null;
|
|
|
|
@Column({ default: 0, type: 'int' })
|
|
imageWidth!: number;
|
|
|
|
@Column({ default: 0, type: 'int' })
|
|
imageHeight!: number;
|
|
|
|
@Column({ default: 0, type: 'int' })
|
|
boundingBoxX1!: number;
|
|
|
|
@Column({ default: 0, type: 'int' })
|
|
boundingBoxY1!: number;
|
|
|
|
@Column({ default: 0, type: 'int' })
|
|
boundingBoxX2!: number;
|
|
|
|
@Column({ default: 0, type: 'int' })
|
|
boundingBoxY2!: number;
|
|
|
|
@ManyToOne(() => AssetEntity, (asset) => asset.faces, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
|
|
asset!: AssetEntity;
|
|
|
|
@ManyToOne(() => PersonEntity, (person) => person.faces, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: true })
|
|
person!: PersonEntity | null;
|
|
}
|