mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 17:25:11 +03:00
feat: kysely migrations (#17198)
This commit is contained in:
24
server/src/schema/tables/move.table.ts
Normal file
24
server/src/schema/tables/move.table.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { PathType } from 'src/enum';
|
||||
import { Column, PrimaryGeneratedColumn, Table, Unique } from 'src/sql-tools';
|
||||
|
||||
@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!: string;
|
||||
|
||||
@Column({ type: 'uuid' })
|
||||
entityId!: string;
|
||||
|
||||
@Column({ type: 'character varying' })
|
||||
pathType!: PathType;
|
||||
|
||||
@Column({ type: 'character varying' })
|
||||
oldPath!: string;
|
||||
|
||||
@Column({ type: 'character varying' })
|
||||
newPath!: string;
|
||||
}
|
||||
Reference in New Issue
Block a user