mirror of
https://github.com/immich-app/immich.git
synced 2026-03-25 11:08:56 +03:00
18 lines
590 B
TypeScript
18 lines
590 B
TypeScript
import { AssetEditAction, AssetEditActionParameter } from 'src/dtos/editing.dto';
|
|
import { AssetTable } from 'src/schema/tables/asset.table';
|
|
import { Column, ForeignKeyColumn, Generated, PrimaryGeneratedColumn } from 'src/sql-tools';
|
|
|
|
export class AssetEditTable<T extends AssetEditAction = AssetEditAction> {
|
|
@PrimaryGeneratedColumn()
|
|
id!: Generated<string>;
|
|
|
|
@ForeignKeyColumn(() => AssetTable, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false })
|
|
assetId!: string;
|
|
|
|
@Column()
|
|
action!: T;
|
|
|
|
@Column({ type: 'jsonb' })
|
|
parameters!: AssetEditActionParameter[T];
|
|
}
|