From 6cc6bed80622a7289ff2baf0346d459f12afddd3 Mon Sep 17 00:00:00 2001 From: Adisak Date: Tue, 4 Nov 2025 15:16:53 +0700 Subject: [PATCH 1/3] migration --- src/entities/ApiHistory.ts | 6 +++--- ...rApi_and_tokenApi_field_ApiHistoryTable.ts | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/migration/1762243747843-update_size_headerApi_and_tokenApi_field_ApiHistoryTable.ts diff --git a/src/entities/ApiHistory.ts b/src/entities/ApiHistory.ts index c5f640d0..e84263b6 100644 --- a/src/entities/ApiHistory.ts +++ b/src/entities/ApiHistory.ts @@ -6,17 +6,17 @@ import { ApiName } from "./ApiName"; @Entity("apiHistory") export class ApiHistory extends EntityBase { @Column({ + type: 'longtext', nullable: true, comment: "header", - length: 255, - default: null, + default: null, }) headerApi: string; @Column({ + type: 'longtext', nullable: true, comment: "token", - length: 255, default: null, }) tokenApi: string; diff --git a/src/migration/1762243747843-update_size_headerApi_and_tokenApi_field_ApiHistoryTable.ts b/src/migration/1762243747843-update_size_headerApi_and_tokenApi_field_ApiHistoryTable.ts new file mode 100644 index 00000000..bed2927e --- /dev/null +++ b/src/migration/1762243747843-update_size_headerApi_and_tokenApi_field_ApiHistoryTable.ts @@ -0,0 +1,20 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateSizeHeaderApiAndTokenApiFieldApiHistoryTable1762243747843 implements MigrationInterface { + name = 'UpdateSizeHeaderApiAndTokenApiFieldApiHistoryTable1762243747843' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`headerApi\``); + await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`headerApi\` longtext NULL COMMENT 'header'`); + await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`tokenApi\``); + await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`tokenApi\` longtext NULL COMMENT 'token'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`tokenApi\``); + await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`tokenApi\` varchar(255) NULL COMMENT 'token'`); + await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`headerApi\``); + await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`headerApi\` varchar(255) NULL COMMENT 'header'`); + } + +} From 5d742fa8be02e83e0c9fae0ad08588117d51c4af Mon Sep 17 00:00:00 2001 From: Adisak Date: Tue, 4 Nov 2025 15:17:52 +0700 Subject: [PATCH 2/3] #206 --- src/controllers/PositionController.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index e9f8d99e..34be7a8e 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -3704,7 +3704,9 @@ export class PositionController extends Controller { dataMaster.current_holderId = _null; } await this.posMasterRepository.save(dataMaster, { data: request }); - await CreatePosMasterHistoryOfficer(dataMaster.id, request); + if (chkRevision?.orgRevisionIsCurrent) { + await CreatePosMasterHistoryOfficer(dataMaster.id, request); + } setLogDataDiff(request, { before, after: dataMaster }); return new HttpSuccess(); From 2f73ae28744aefefcced12332dce1e4d0724d82f Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 5 Nov 2025 10:07:22 +0700 Subject: [PATCH 3/3] revert --- src/app.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app.ts b/src/app.ts index 368be40f..7f0e0220 100644 --- a/src/app.ts +++ b/src/app.ts @@ -66,9 +66,7 @@ async function main() { } }); - // const cronTime_Oct = "0 0 1 10 *"; - // Test #1912 - const cronTime_Oct = "0 0 4 11 *"; + const cronTime_Oct = "0 0 1 10 *"; cron.schedule(cronTime_Oct, async () => { try { const commandController = new CommandController();