mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 01:11:16 +03:00
fix(server): tag upsert (#12141)
This commit is contained in:
@@ -10,16 +10,18 @@ import {
|
||||
Tree,
|
||||
TreeChildren,
|
||||
TreeParent,
|
||||
Unique,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
@Entity('tags')
|
||||
@Unique(['userId', 'value'])
|
||||
@Tree('closure-table')
|
||||
export class TagEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column({ unique: true })
|
||||
@Column()
|
||||
value!: string;
|
||||
|
||||
@CreateDateColumn({ type: 'timestamptz' })
|
||||
@@ -31,6 +33,9 @@ export class TagEntity {
|
||||
@Column({ type: 'varchar', nullable: true, default: null })
|
||||
color!: string | null;
|
||||
|
||||
@Column({ nullable: true })
|
||||
parentId?: string;
|
||||
|
||||
@TreeParent({ onDelete: 'CASCADE' })
|
||||
parent?: TagEntity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user