mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 15:38:24 -08:00
23 lines
631 B
TypeScript
23 lines
631 B
TypeScript
import { Column, Entity, Index, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { AssetEntity } from './asset.entity';
|
|
|
|
@Entity('smart_info')
|
|
export class SmartInfoEntity {
|
|
@PrimaryGeneratedColumn()
|
|
id: string;
|
|
|
|
@Index({ unique: true })
|
|
@Column({ type: 'uuid' })
|
|
assetId: string;
|
|
|
|
@Column({ type: 'text', array: true, nullable: true })
|
|
tags: string[];
|
|
|
|
@Column({ type: 'text', array: true, nullable: true })
|
|
objects: string[];
|
|
|
|
@OneToOne(() => AssetEntity, { onDelete: 'CASCADE', nullable: true })
|
|
@JoinColumn({ name: 'assetId', referencedColumnName: 'id' })
|
|
asset: SmartInfoEntity;
|
|
}
|