immich/server/src/schema/tables/move.table.ts
Daniel Dietzler a07d7b0c82
chore: migrate to sql-tools library (#26400)
Co-authored-by: Jason Rasmussen <jason@rasm.me>
2026-02-23 09:50:16 -05:00

25 lines
658 B
TypeScript

import { Column, Generated, PrimaryGeneratedColumn, Table, Unique } from '@immich/sql-tools';
import { PathType } from 'src/enum';
@Table('move_history')
// path lock (per entity)
@Unique({ name: 'UQ_entityId_pathType', columns: ['entityId', 'pathType'] })
// new path lock (global)
@Unique({ name: 'UQ_newPath', columns: ['newPath'] })
export class MoveTable {
@PrimaryGeneratedColumn()
id!: Generated<string>;
@Column({ type: 'uuid' })
entityId!: string;
@Column({ type: 'character varying' })
pathType!: PathType;
@Column({ type: 'character varying' })
oldPath!: string;
@Column({ type: 'character varying' })
newPath!: string;
}