mirror of
https://github.com/immich-app/immich.git
synced 2025-11-15 19:13:20 -05:00
21 lines
623 B
TypeScript
21 lines
623 B
TypeScript
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
|
import { Column, Entity, Index, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
|
|
|
@Entity('face_search', { synchronize: false })
|
|
export class FaceSearchEntity {
|
|
@OneToOne(() => AssetFaceEntity, { onDelete: 'CASCADE', nullable: true })
|
|
@JoinColumn({ name: 'faceId', referencedColumnName: 'id' })
|
|
face?: AssetFaceEntity;
|
|
|
|
@PrimaryColumn()
|
|
faceId!: string;
|
|
|
|
@Index('face_index', { synchronize: false })
|
|
@Column({
|
|
type: 'float4',
|
|
array: true,
|
|
transformer: { from: JSON.parse, to: (v) => `[${v}]` },
|
|
})
|
|
embedding!: number[];
|
|
}
|