feat: kysely migrations (#17198)

This commit is contained in:
Jason Rasmussen
2025-03-29 09:26:24 -04:00
committed by GitHub
parent 6fa0cb534a
commit 55a3c30664
45 changed files with 267 additions and 126 deletions

View 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;
}