690523:2327 ADR-028-228-migration #01
CI / CD Pipeline / build (push) Successful in 4m38s
CI / CD Pipeline / deploy (push) Successful in 3m6s

This commit is contained in:
2026-05-23 23:27:52 +07:00
parent ff5cadc9f2
commit 5a17f969b8
23 changed files with 1169 additions and 252 deletions
@@ -0,0 +1,32 @@
// File: src/modules/ai/entities/migration-progress.entity.ts
// Change Log:
// - 2026-05-23: สร้าง entity สำหรับ migration_progress table (Checkpoint management ADR-023A)
import { Column, Entity, PrimaryColumn, UpdateDateColumn } from 'typeorm';
export enum MigrationProgressStatus {
RUNNING = 'RUNNING',
COMPLETED = 'COMPLETED',
FAILED = 'FAILED',
}
/** ตารางติดตามความคืบหน้า Batch Migration — ใช้สำหรับ Resume กรณี n8n หยุดกลางทาง */
@Entity('migration_progress')
export class MigrationProgress {
@PrimaryColumn({ name: 'batch_id', type: 'varchar', length: 50 })
batchId!: string;
@Column({ name: 'last_processed_index', type: 'int', default: 0 })
lastProcessedIndex!: number;
@Column({
name: 'STATUS',
type: 'enum',
enum: MigrationProgressStatus,
default: MigrationProgressStatus.RUNNING,
})
status!: MigrationProgressStatus;
@UpdateDateColumn({ name: 'updated_at' })
updatedAt!: Date;
}
@@ -15,6 +15,7 @@ import { UuidBaseEntity } from '../../../common/entities/uuid-base.entity';
export enum MigrationReviewRecordStatus {
PENDING = 'PENDING',
PENDING_REVIEW = 'PENDING_REVIEW',
IMPORTED = 'IMPORTED',
REJECTED = 'REJECTED',
}