From b36ca756d42a3fe9211ca2393ad30b1a1082963d Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Tue, 4 Feb 2025 15:34:36 +0700 Subject: [PATCH] migrate --- src/migration/1738657968680-updateroleadddna1.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/migration/1738657968680-updateroleadddna1.ts diff --git a/src/migration/1738657968680-updateroleadddna1.ts b/src/migration/1738657968680-updateroleadddna1.ts new file mode 100644 index 0000000..e1cef91 --- /dev/null +++ b/src/migration/1738657968680-updateroleadddna1.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class Updateroleadddna11738657968680 implements MigrationInterface { + name = 'Updateroleadddna11738657968680' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryOrgEmployee\` ADD \`rootDnaId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง orgRoot Dna'`); + await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`rootDnaId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง orgRoot Dna'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`rootDnaId\``); + await queryRunner.query(`ALTER TABLE \`salaryOrgEmployee\` DROP COLUMN \`rootDnaId\``); + } + +}