feat(server): allow unassigned asset-faces (#4474)

* 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>
This commit is contained in:
martin
2023-10-24 15:12:42 +02:00
committed by GitHub
parent d4c23c8df8
commit 99c6f8fb13
9 changed files with 71 additions and 22 deletions

View File

@@ -1,14 +1,17 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { AssetEntity } from './asset.entity';
import { PersonEntity } from './person.entity';
@Entity('asset_faces')
export class AssetFaceEntity {
@PrimaryColumn()
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column()
assetId!: string;
@PrimaryColumn()
personId!: string;
@Column({ nullable: true, type: 'uuid' })
personId!: string | null;
@Column({
type: 'float4',
@@ -38,6 +41,6 @@ export class AssetFaceEntity {
@ManyToOne(() => AssetEntity, (asset) => asset.faces, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
asset!: AssetEntity;
@ManyToOne(() => PersonEntity, (person) => person.faces, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
person!: PersonEntity;
@ManyToOne(() => PersonEntity, (person) => person.faces, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: true })
person!: PersonEntity | null;
}