2022-02-19 22:42:10 -06:00
|
|
|
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[];
|
|
|
|
|
|
2022-03-27 14:58:54 -05:00
|
|
|
@Column({ type: 'text', array: true, nullable: true })
|
|
|
|
|
objects: string[];
|
|
|
|
|
|
2022-02-19 22:42:10 -06:00
|
|
|
@OneToOne(() => AssetEntity, { onDelete: 'CASCADE', nullable: true })
|
|
|
|
|
@JoinColumn({ name: 'assetId', referencedColumnName: 'id' })
|
|
|
|
|
asset: SmartInfoEntity;
|
|
|
|
|
}
|