1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/model/sql/enitites/PersonEntry.ts

18 lines
391 B
TypeScript
Raw Normal View History

2019-01-12 23:41:45 +08:00
import {Column, Entity, OneToMany, PrimaryGeneratedColumn, Unique, Index} from 'typeorm';
import {FaceRegionEntry} from './FaceRegionEntry';
@Entity()
@Unique(['name'])
export class PersonEntry {
@Index()
@PrimaryGeneratedColumn()
id: number;
@Column()
name: string;
@OneToMany(type => FaceRegionEntry, faceRegion => faceRegion.person)
public faces: FaceRegionEntry[];
}