diff --git a/src/controllers/EmployeePositionController.ts b/src/controllers/EmployeePositionController.ts index b2714b4b..7b73970d 100644 --- a/src/controllers/EmployeePositionController.ts +++ b/src/controllers/EmployeePositionController.ts @@ -1348,7 +1348,16 @@ export class EmployeePositionController extends Controller { : posMaster.ancestorDNA, }, order: { lastUpdatedAt: "DESC" }, - relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"], + relations: [ + "orgRoot", + "orgChild1", + "orgChild2", + "orgChild3", + "orgChild4", + "positions", + "positions.posLevel", + "positions.posType", + ], }); const _data = posMasters.map((item) => ({ id: item.id, @@ -1369,6 +1378,9 @@ export class EmployeePositionController extends Controller { posMasterNo: item.posMasterNo ? item.posMasterNo : null, posMasterNoSuffix: item.posMasterNoSuffix ? item.posMasterNoSuffix : null, reason: item.reason ? item.reason : null, + position: item.positions.map((x) => x.positionName).join("/"), + posLevel: item.positions.map((x) => x.posLevel.posLevelName).join("/"), + posType: item.positions.map((x) => x.posType.posTypeName).join("/"), })); return new HttpSuccess(_data); } diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 59bb8620..450cefeb 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -844,7 +844,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild1.orgChild1Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - responsibility: orgRoot.responsibility, + responsibility: orgChild1.responsibility, labelName: orgChild1.orgChild1Name + " " + @@ -959,7 +959,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild2.orgChild2Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - responsibility: orgRoot.responsibility, + responsibility: orgChild2.responsibility, labelName: orgChild2.orgChild2Name + " " + @@ -1077,7 +1077,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild3.orgChild3Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - responsibility: orgRoot.responsibility, + responsibility: orgChild3.responsibility, labelName: orgChild3.orgChild3Name + " " + @@ -1195,7 +1195,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild4.orgChild4Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - responsibility: orgRoot.responsibility, + responsibility: orgChild4.responsibility, labelName: orgChild4.orgChild4Name + " " + diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index 992d0238..b2d531ce 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -194,7 +194,9 @@ export class OrganizationUnauthorizeController extends Controller { const latestProfileAssessment = item.current_holder.profileAssessments ? item.current_holder.profileAssessments.sort((a: any, b: any) => b.date - a.date)[0] : null; - const pointSum = latestProfileAssessment ? latestProfileAssessment.pointSum : null; + const pointSum = latestProfileAssessment + ? `(${this.textPointSummaryKpi(latestProfileAssessment.pointSum)})${latestProfileAssessment.pointSum}` + : null; return { id: item.id, profileId: item.current_holder.id, @@ -404,7 +406,9 @@ export class OrganizationUnauthorizeController extends Controller { const latestProfileAssessment = item.current_holder.profileAssessments ? item.current_holder.profileAssessments.sort((a: any, b: any) => b.date - a.date)[0] : null; - const pointSum = latestProfileAssessment ? latestProfileAssessment.pointSum : null; + const pointSum = latestProfileAssessment + ? `(${this.textPointSummaryKpi(latestProfileAssessment.pointSum)})${latestProfileAssessment.pointSum}` + : null; return { profileId: item.current_holder.id, salaryLevel: item.current_holder.salaryLevel, @@ -841,4 +845,13 @@ export class OrganizationUnauthorizeController extends Controller { posTypeId: findProfile.posTypeId, }); } + textPointSummaryKpi(val: number | undefined) { + if (val == undefined || val == null) val = -1; + if (val >= 0 && val <= 60) return "ต้องปรับปรุง"; + if (val >= 60 && val <= 69) return "พอใช้"; + if (val >= 70 && val <= 79) return "ดี"; + if (val >= 80 && val <= 89) return "ดีมาก"; + if (val >= 90 && val <= 100) return "ดีเด่น"; + else return "-"; + } } diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index e9d1499f..1e1928e2 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1568,7 +1568,18 @@ export class PositionController extends Controller { : posMaster.ancestorDNA, }, order: { lastUpdatedAt: "DESC" }, - relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"], + relations: [ + "orgRoot", + "orgChild1", + "orgChild2", + "orgChild3", + "orgChild4", + "current_holder", + "positions", + "positions.posLevel", + "positions.posType", + "positions.posExecutive", + ], }); const _data = posMasters.map((item) => ({ id: item.id, @@ -1589,6 +1600,16 @@ export class PositionController extends Controller { posMasterNo: item.posMasterNo ? item.posMasterNo : null, posMasterNoSuffix: item.posMasterNoSuffix ? item.posMasterNoSuffix : null, reason: item.reason ? item.reason : null, + position: item.positions.map((x) => x.positionName).join("/"), + posExecutive: item.positions.map((x) => x.posExecutive.posExecutiveName).join("/"), + posLevel: item.positions.map((x) => x.posLevel.posLevelName).join("/"), + posType: item.positions.map((x) => x.posType.posTypeName).join("/"), + fullname: + item.current_holder.prefix + + " " + + item.current_holder.firstName + + " " + + item.current_holder.lastName, })); return new HttpSuccess(_data); } diff --git a/src/migration/1710565430715-add_table_profilesalaryemployee.ts b/src/migration/1710565430715-add_table_profilesalaryemployee.ts deleted file mode 100644 index ae6c96ad..00000000 --- a/src/migration/1710565430715-add_table_profilesalaryemployee.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class AddTableProfilesalaryemployee1710565430715 implements MigrationInterface { - name = 'AddTableProfilesalaryemployee1710565430715' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE \`profileSalaryEmployeeHistory\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่', \`amount\` double NULL COMMENT 'เงินเดือนฐาน' DEFAULT '0', \`positionSalaryAmount\` double NULL COMMENT 'เงินประจำตำแหน่ง' DEFAULT '0', \`mouthSalaryAmount\` double NULL COMMENT 'เงินค่าตอบแทนรายเดือน' DEFAULT '0', \`profileId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง profile', \`isActive\` tinyint NOT NULL COMMENT 'สถานะการใช้งาน' DEFAULT 0, \`salaryClass\` text NULL COMMENT 'ตำแหน่ง (รายละเอียด)', \`salaryRef\` text NULL COMMENT 'เอกสารอ้างอิง', \`posNoId\` varchar(40) NULL COMMENT 'Id เลขที่ตำแหน่ง', \`positionId\` varchar(40) NULL COMMENT 'Id เลขที่ตำแหน่ง', \`ocId\` varchar(40) NULL COMMENT 'Id สังกัด', \`positionExecutiveId\` varchar(40) NULL COMMENT 'Id ตำแหน่งทางการบริหาร', \`positionExecutiveSideId\` varchar(40) NULL COMMENT 'Id ด้านทางการบริหาร', \`positionLevelId\` varchar(40) NULL, \`positionLineId\` varchar(40) NULL COMMENT 'Id สายงาน', \`positionPathSideId\` varchar(40) NULL COMMENT 'Id ด้าน/สาขา', \`positionTypeId\` varchar(40) NULL COMMENT 'Id ประเภทตำแหน่ง', \`organizationShortNameId\` varchar(40) NULL COMMENT 'Id ชื่อย่อหน่วยงาน', \`positionEmployeeGroupId\` varchar(40) NULL COMMENT 'Id กลุ่มงาน', \`positionEmployeeLevelId\` varchar(40) NULL COMMENT 'Id ระดับชั้นงาน', \`positionEmployeePositionId\` varchar(40) NULL COMMENT 'Id ตำแหน่ง', \`positionEmployeePositionSideId\` varchar(40) NULL COMMENT 'Id ด้านของตำแหน่ง', \`posNoEmployee\` varchar(40) NULL COMMENT 'Id เลขที่ตำแหน่งลูกจ้าง', \`refCommandDate\` datetime NULL COMMENT 'เอกสารอ้างอิง (ลงวันที่)', \`refCommandNo\` text NULL COMMENT 'เอกสารอ้างอิง (เลขที่คำสั่ง)', \`order\` int NULL COMMENT 'ลำดับ', \`commandNo\` text NOT NULL COMMENT 'เลขที่คำสั่ง', \`commandTypeName\` text NOT NULL COMMENT 'ประเภทคำสั่ง', \`salaryStatus\` text NULL COMMENT 'ประเภทตำแหน่งกรณีพิเศษ', \`profileSalaryId\` varchar(36) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`profileDisciplineEmployeeHistory\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่', \`profileDisciplineId\` varchar(40) NOT NULL COMMENT 'ล้างมลทิน', \`isActive\` tinyint NOT NULL COMMENT 'สถานะการใช้งาน' DEFAULT 0, \`level\` text NULL COMMENT 'ระดับความผิด', \`detail\` text NULL COMMENT 'รายละเอียด', \`refCommandDate\` datetime NULL COMMENT 'เอกสารอ้างอิง (ลงวันที่)', \`refCommandNo\` text NULL COMMENT 'เอกสารอ้างอิง (เลขที่คำสั่ง)', \`unStigma\` text NULL COMMENT 'ล้างมลทิน', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`profileDisciplineEmployee\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่', \`profileId\` varchar(40) NOT NULL COMMENT 'ไอดีโปรไฟล์', \`isActive\` tinyint NOT NULL COMMENT 'สถานะการใช้งาน' DEFAULT 0, \`level\` text NULL COMMENT 'ระดับความผิด', \`detail\` text NULL COMMENT 'รายละเอียด', \`refCommandDate\` datetime NULL COMMENT 'เอกสารอ้างอิง (ลงวันที่)', \`refCommandNo\` text NULL COMMENT 'เอกสารอ้างอิง (เลขที่คำสั่ง)', \`unStigma\` text NULL COMMENT 'ล้างมลทิน', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`profileSalaryEmployee\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่', \`amount\` double NULL COMMENT 'เงินเดือนฐาน' DEFAULT '0', \`positionSalaryAmount\` double NULL COMMENT 'เงินประจำตำแหน่ง' DEFAULT '0', \`mouthSalaryAmount\` double NULL COMMENT 'เงินค่าตอบแทนรายเดือน' DEFAULT '0', \`profileId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง profile', \`isActive\` tinyint NOT NULL COMMENT 'สถานะการใช้งาน' DEFAULT 0, \`salaryClass\` text NULL COMMENT 'ตำแหน่ง (รายละเอียด)', \`salaryRef\` text NULL COMMENT 'เอกสารอ้างอิง', \`posNoId\` varchar(40) NULL COMMENT 'Id เลขที่ตำแหน่ง', \`positionId\` varchar(40) NULL COMMENT 'Id เลขที่ตำแหน่ง', \`ocId\` varchar(40) NULL COMMENT 'Id สังกัด', \`positionExecutiveId\` varchar(40) NULL COMMENT 'Id ตำแหน่งทางการบริหาร', \`positionExecutiveSideId\` varchar(40) NULL COMMENT 'Id ด้านทางการบริหาร', \`positionLevelId\` varchar(40) NULL, \`positionLineId\` varchar(40) NULL COMMENT 'Id สายงาน', \`positionPathSideId\` varchar(40) NULL COMMENT 'Id ด้าน/สาขา', \`positionTypeId\` varchar(40) NULL COMMENT 'Id ประเภทตำแหน่ง', \`organizationShortNameId\` varchar(40) NULL COMMENT 'Id ชื่อย่อหน่วยงาน', \`positionEmployeeGroupId\` varchar(40) NULL COMMENT 'Id กลุ่มงาน', \`positionEmployeeLevelId\` varchar(40) NULL COMMENT 'Id ระดับชั้นงาน', \`positionEmployeePositionId\` varchar(40) NULL COMMENT 'Id ตำแหน่ง', \`positionEmployeePositionSideId\` varchar(40) NULL COMMENT 'Id ด้านของตำแหน่ง', \`posNoEmployee\` varchar(40) NULL COMMENT 'Id เลขที่ตำแหน่งลูกจ้าง', \`refCommandDate\` datetime NULL COMMENT 'เอกสารอ้างอิง (ลงวันที่)', \`refCommandNo\` text NULL COMMENT 'เอกสารอ้างอิง (เลขที่คำสั่ง)', \`order\` int NULL COMMENT 'ลำดับ', \`commandNo\` text NOT NULL COMMENT 'เลขที่คำสั่ง', \`commandTypeName\` text NOT NULL COMMENT 'ประเภทคำสั่ง', \`salaryStatus\` text NULL COMMENT 'ประเภทตำแหน่งกรณีพิเศษ', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`ALTER TABLE \`profileSalaryEmployeeHistory\` ADD CONSTRAINT \`FK_3a5e3b1bfea204cbbf095acea0f\` FOREIGN KEY (\`profileSalaryId\`) REFERENCES \`profileSalaryEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`profileDisciplineEmployeeHistory\` ADD CONSTRAINT \`FK_690234b4b797340d6ceea505484\` FOREIGN KEY (\`profileDisciplineId\`) REFERENCES \`profileDisciplineEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`profileDisciplineEmployee\` ADD CONSTRAINT \`FK_91bb620891d3e21cacadb1bba4c\` FOREIGN KEY (\`profileId\`) REFERENCES \`profileEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`profileSalaryEmployee\` ADD CONSTRAINT \`FK_d9c86788039c9e116cb10567408\` FOREIGN KEY (\`profileId\`) REFERENCES \`profileEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileSalaryEmployee\` DROP FOREIGN KEY \`FK_d9c86788039c9e116cb10567408\``); - await queryRunner.query(`ALTER TABLE \`profileDisciplineEmployee\` DROP FOREIGN KEY \`FK_91bb620891d3e21cacadb1bba4c\``); - await queryRunner.query(`ALTER TABLE \`profileDisciplineEmployeeHistory\` DROP FOREIGN KEY \`FK_690234b4b797340d6ceea505484\``); - await queryRunner.query(`ALTER TABLE \`profileSalaryEmployeeHistory\` DROP FOREIGN KEY \`FK_3a5e3b1bfea204cbbf095acea0f\``); - await queryRunner.query(`DROP TABLE \`profileSalaryEmployee\``); - await queryRunner.query(`DROP TABLE \`profileDisciplineEmployee\``); - await queryRunner.query(`DROP TABLE \`profileDisciplineEmployeeHistory\``); - await queryRunner.query(`DROP TABLE \`profileSalaryEmployeeHistory\``); - } - -} diff --git a/src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts b/src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts deleted file mode 100644 index 6aa36535..00000000 --- a/src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableSalaryprofileAddSalarylevel1710744584780 implements MigrationInterface { - name = 'UpdateTableSalaryprofileAddSalarylevel1710744584780' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`salaryLevel\` double NULL COMMENT 'ขั้นเงินเดือน'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`salaryLevel\``); - } - -} diff --git a/src/migration/1710748447345-update_table_salaryprofile_add_salarylevel1.ts b/src/migration/1710748447345-update_table_salaryprofile_add_salarylevel1.ts deleted file mode 100644 index d94c3370..00000000 --- a/src/migration/1710748447345-update_table_salaryprofile_add_salarylevel1.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableSalaryprofileAddSalarylevel11710748447345 implements MigrationInterface { - name = 'UpdateTableSalaryprofileAddSalarylevel11710748447345' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEducation\` ADD \`note\` varchar(255) NULL COMMENT 'หมายเหตุ'`); - await queryRunner.query(`ALTER TABLE \`profileInsignia\` ADD \`note\` varchar(255) NULL COMMENT 'หมายเหตุ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileInsignia\` DROP COLUMN \`note\``); - await queryRunner.query(`ALTER TABLE \`profileEducation\` DROP COLUMN \`note\``); - } - -} diff --git a/src/migration/1710749867773-update_table_profile_history_add_note.ts b/src/migration/1710749867773-update_table_profile_history_add_note.ts deleted file mode 100644 index 1d3cc342..00000000 --- a/src/migration/1710749867773-update_table_profile_history_add_note.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileHistoryAddNote1710749867773 implements MigrationInterface { - name = 'UpdateTableProfileHistoryAddNote1710749867773' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEducationHistory\` ADD \`note\` varchar(255) NULL COMMENT 'หมายเหตุ'`); - await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` ADD \`note\` varchar(255) NULL COMMENT 'หมายเหตุ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` DROP COLUMN \`note\``); - await queryRunner.query(`ALTER TABLE \`profileEducationHistory\` DROP COLUMN \`note\``); - } - -} diff --git a/src/migration/1710752446531-update_table_profile_history_add_is_date.ts b/src/migration/1710752446531-update_table_profile_history_add_is_date.ts deleted file mode 100644 index bc408b1d..00000000 --- a/src/migration/1710752446531-update_table_profile_history_add_is_date.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileHistoryAddIsDate1710752446531 implements MigrationInterface { - name = 'UpdateTableProfileHistoryAddIsDate1710752446531' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` ADD \`isDate\` tinyint NULL COMMENT 'ประเภทช่วงเวลาการศึกษา'`); - await queryRunner.query(`ALTER TABLE \`profileTrainingHistory\` ADD \`isDate\` tinyint NULL COMMENT 'ประเภทช่วงเวลาการศึกษา'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileTrainingHistory\` DROP COLUMN \`isDate\``); - await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` DROP COLUMN \`isDate\``); - } - -} diff --git a/src/migration/1710758420804-update_table_profile_insignia_relation.ts b/src/migration/1710758420804-update_table_profile_insignia_relation.ts deleted file mode 100644 index ea6744eb..00000000 --- a/src/migration/1710758420804-update_table_profile_insignia_relation.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileInsigniaRelation1710758420804 implements MigrationInterface { - name = 'UpdateTableProfileInsigniaRelation1710758420804' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileInsignia\` DROP COLUMN \`insigniaType\``); - await queryRunner.query(`ALTER TABLE \`profileInsignia\` ADD CONSTRAINT \`FK_7048ee3f58edbb05c9ab4e36a8d\` FOREIGN KEY (\`insigniaId\`) REFERENCES \`insignia\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileInsignia\` DROP FOREIGN KEY \`FK_7048ee3f58edbb05c9ab4e36a8d\``); - await queryRunner.query(`ALTER TABLE \`profileInsignia\` ADD \`insigniaType\` text NULL COMMENT 'ประเภท'`); - } - -} diff --git a/src/migration/1710759276845-update_table_profile_insignia_history_relation.ts b/src/migration/1710759276845-update_table_profile_insignia_history_relation.ts deleted file mode 100644 index f00707f1..00000000 --- a/src/migration/1710759276845-update_table_profile_insignia_history_relation.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileInsigniaHistoryRelation1710759276845 implements MigrationInterface { - name = 'UpdateTableProfileInsigniaHistoryRelation1710759276845' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`insignia\` DROP FOREIGN KEY \`FK_440663b355747c7041d0f57b18f\``); - await queryRunner.query(`ALTER TABLE \`insignia\` DROP COLUMN \`insigniaId\``); - await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` DROP COLUMN \`insigniaType\``); - await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` ADD CONSTRAINT \`FK_262ceb7a87af7800f4da2c8f17d\` FOREIGN KEY (\`insigniaId\`) REFERENCES \`insignia\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` DROP FOREIGN KEY \`FK_262ceb7a87af7800f4da2c8f17d\``); - await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` ADD \`insigniaType\` text NULL COMMENT 'ประเภท'`); - await queryRunner.query(`ALTER TABLE \`insignia\` ADD \`insigniaId\` varchar(36) NULL`); - await queryRunner.query(`ALTER TABLE \`insignia\` ADD CONSTRAINT \`FK_440663b355747c7041d0f57b18f\` FOREIGN KEY (\`insigniaId\`) REFERENCES \`profileInsignia\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - -} diff --git a/src/migration/1716192898403-update_table_20_05_24.ts b/src/migration/1716192898403-update_table_20_05_24.ts deleted file mode 100644 index 035852d0..00000000 --- a/src/migration/1716192898403-update_table_20_05_24.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTable2005241716192898403 implements MigrationInterface { - name = 'UpdateTable2005241716192898403' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`reasonSameDate\` varchar(255) NULL COMMENT 'เหตุผลกรณีวันไม่ตรงกัน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`reasonSameDate\` varchar(255) NULL COMMENT 'เหตุผลกรณีวันไม่ตรงกัน'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`reasonSameDate\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`govAgePlus\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`govAgeAbsent\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`dateStart\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`dateAppoint\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`reasonSameDate\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`govAgePlus\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`govAgeAbsent\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`dateStart\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`dateAppoint\``); - } - -} diff --git a/src/migration/1716649829280-update_table_profile_add_leaveReason.ts b/src/migration/1716649829280-update_table_profile_add_leaveReason.ts deleted file mode 100644 index db8fd2da..00000000 --- a/src/migration/1716649829280-update_table_profile_add_leaveReason.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileAddLeaveReason1716649829280 implements MigrationInterface { - name = 'UpdateTableProfileAddLeaveReason1716649829280' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profile\` ADD \`leaveReason\` varchar(255) NULL COMMENT 'เหตุผลเกษียณ'`); - await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`leaveReason\` varchar(255) NULL COMMENT 'เหตุผลเกษียณ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`leaveReason\``); - await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`leaveReason\``); - } - -} diff --git a/src/migration/1716867925436-update_table_profile_add_duty.ts b/src/migration/1716867925436-update_table_profile_add_duty.ts deleted file mode 100644 index bb24c61b..00000000 --- a/src/migration/1716867925436-update_table_profile_add_duty.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileAddDuty1716867925436 implements MigrationInterface { - name = 'UpdateTableProfileAddDuty1716867925436' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dutyTimeId\` varchar(40) NULL COMMENT 'ไอดีรอบลงเวลาล่าสุด'`); - await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dutyTimeEffectiveDate\` datetime NULL COMMENT 'รอบลงเวลาล่าสุด'`); - await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dutyTimeId\` varchar(40) NULL COMMENT 'ไอดีรอบลงเวลาล่าสุด'`); - await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dutyTimeEffectiveDate\` datetime NULL COMMENT 'รอบลงเวลาล่าสุด'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dutyTimeEffectiveDate\``); - await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dutyTimeId\``); - await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dutyTimeEffectiveDate\``); - await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dutyTimeId\``); - } - -} diff --git a/src/migration/1717657751779-update_table_salaryProfile_add_rank1.ts b/src/migration/1717657751779-update_table_salaryProfile_add_rank1.ts deleted file mode 100644 index f461db6d..00000000 --- a/src/migration/1717657751779-update_table_salaryProfile_add_rank1.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableSalaryProfileAddRank11717657751779 implements MigrationInterface { - name = 'UpdateTableSalaryProfileAddRank11717657751779' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posmasterIdTemp\` varchar(255) NULL COMMENT 'id อัตรา'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`nodeTemp\` varchar(255) NULL COMMENT 'node'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`nodeIdTemp\` varchar(255) NULL COMMENT 'id node'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`orgRevisionIdTemp\` varchar(255) NULL COMMENT 'id Revision'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionIdTemp\` varchar(255) NULL COMMENT 'id position'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posMasterNoTemp\` varchar(255) NULL COMMENT 'เลขที่ตำแหน่ง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionFieldTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posTypeIdTemp\` varchar(255) NULL COMMENT 'id ประเภท'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posTypeNameTemp\` varchar(255) NULL COMMENT 'ประเภท'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posLevelIdTemp\` varchar(255) NULL COMMENT 'id ระดับ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posLevelNameTemp\` varchar(255) NULL COMMENT 'ระดับ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootTemp\` varchar(255) NULL COMMENT 'ชื่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootId\` varchar(255) NULL COMMENT 'id root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1Temp\` varchar(255) NULL COMMENT 'ชื่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1Id\` varchar(255) NULL COMMENT 'id child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2Temp\` varchar(255) NULL COMMENT 'ชื่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2Id\` varchar(255) NULL COMMENT 'id child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3Temp\` varchar(255) NULL COMMENT 'ชื่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3Id\` varchar(255) NULL COMMENT 'id child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4Temp\` varchar(255) NULL COMMENT 'ชื่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4Id\` varchar(255) NULL COMMENT 'id child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posmasterIdTemp\` varchar(255) NULL COMMENT 'id อัตรา'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`nodeTemp\` varchar(255) NULL COMMENT 'node'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`nodeIdTemp\` varchar(255) NULL COMMENT 'id node'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`orgRevisionIdTemp\` varchar(255) NULL COMMENT 'id Revision'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionIdTemp\` varchar(255) NULL COMMENT 'id position'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posMasterNoTemp\` varchar(255) NULL COMMENT 'เลขที่ตำแหน่ง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionFieldTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posTypeIdTemp\` varchar(255) NULL COMMENT 'id ประเภท'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posTypeNameTemp\` varchar(255) NULL COMMENT 'ประเภท'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posLevelIdTemp\` varchar(255) NULL COMMENT 'id ระดับ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posLevelNameTemp\` varchar(255) NULL COMMENT 'ระดับ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootTemp\` varchar(255) NULL COMMENT 'ชื่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootId\` varchar(255) NULL COMMENT 'id root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1Temp\` varchar(255) NULL COMMENT 'ชื่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1Id\` varchar(255) NULL COMMENT 'id child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2Temp\` varchar(255) NULL COMMENT 'ชื่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2Id\` varchar(255) NULL COMMENT 'id child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3Temp\` varchar(255) NULL COMMENT 'ชื่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3Id\` varchar(255) NULL COMMENT 'id child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4Temp\` varchar(255) NULL COMMENT 'ชื่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4Id\` varchar(255) NULL COMMENT 'id child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posLevelNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posLevelIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posTypeNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posTypeIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionFieldTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posMasterNoTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`orgRevisionIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`nodeIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`nodeTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posmasterIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1Temp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posLevelNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posLevelIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posTypeNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posTypeIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionFieldTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posMasterNoTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`orgRevisionIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`nodeIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`nodeTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posmasterIdTemp\``); - } - -} diff --git a/src/migration/1717658073146-update_table_salaryProfile_add_temp.ts b/src/migration/1717658073146-update_table_salaryProfile_add_temp.ts deleted file mode 100644 index e4644665..00000000 --- a/src/migration/1717658073146-update_table_salaryProfile_add_temp.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableSalaryProfileAddTemp1717658073146 implements MigrationInterface { - name = 'UpdateTableSalaryProfileAddTemp1717658073146' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4Id\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4ShortName\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootIdTemp\` varchar(255) NULL COMMENT 'id root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1IdTemp\` varchar(255) NULL COMMENT 'id child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2IdTemp\` varchar(255) NULL COMMENT 'id child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3IdTemp\` varchar(255) NULL COMMENT 'id child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4IdTemp\` varchar(255) NULL COMMENT 'id child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`statusTemp\` varchar(255) NULL COMMENT 'สถานะลูกจ่างชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootIdTemp\` varchar(255) NULL COMMENT 'id root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1IdTemp\` varchar(255) NULL COMMENT 'id child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2IdTemp\` varchar(255) NULL COMMENT 'id child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3IdTemp\` varchar(255) NULL COMMENT 'id child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4IdTemp\` varchar(255) NULL COMMENT 'id child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4ShortNameTemp\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`statusTemp\` varchar(255) NULL COMMENT 'สถานะลูกจ่างชั่วคราว'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`statusTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`statusTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1ShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1IdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootShortNameTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootIdTemp\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4Id\` varchar(255) NULL COMMENT 'id child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3Id\` varchar(255) NULL COMMENT 'id child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2Id\` varchar(255) NULL COMMENT 'id child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1Id\` varchar(255) NULL COMMENT 'id child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootId\` varchar(255) NULL COMMENT 'id root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4Id\` varchar(255) NULL COMMENT 'id child4'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3Id\` varchar(255) NULL COMMENT 'id child3'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2Id\` varchar(255) NULL COMMENT 'id child2'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1Id\` varchar(255) NULL COMMENT 'id child1'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootId\` varchar(255) NULL COMMENT 'id root'`); - } - -} diff --git a/src/migration/1717671751714-update_table_Profile_add_dateLeave.ts b/src/migration/1717671751714-update_table_Profile_add_dateLeave.ts deleted file mode 100644 index f0a1aa09..00000000 --- a/src/migration/1717671751714-update_table_Profile_add_dateLeave.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileAddDateLeave1717671751714 implements MigrationInterface { - name = 'UpdateTableProfileAddDateLeave1717671751714' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dateLeave\` datetime NULL COMMENT 'วันพ้นราชการ'`); - await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dateLeave\` datetime NULL COMMENT 'วันพ้นราชการ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dateLeave\``); - await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dateLeave\``); - } - -} diff --git a/src/migration/1717688401552-update_table_salaryProfileemp_add_temp.ts b/src/migration/1717688401552-update_table_salaryProfileemp_add_temp.ts deleted file mode 100644 index b5b03822..00000000 --- a/src/migration/1717688401552-update_table_salaryProfileemp_add_temp.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableSalaryProfileempAddTemp1717688401552 implements MigrationInterface { - name = 'UpdateTableSalaryProfileempAddTemp1717688401552' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`isLeave\` tinyint NOT NULL COMMENT 'เกษียณ' DEFAULT 0`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`leaveReason\` varchar(255) NULL COMMENT 'เหตุผลเกษียณ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`dateLeave\` datetime NULL COMMENT 'วันพ้นราชการ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`isLeave\` tinyint NOT NULL COMMENT 'เกษียณ' DEFAULT 0`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`leaveReason\` varchar(255) NULL COMMENT 'เหตุผลเกษียณ'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`dateLeave\` datetime NULL COMMENT 'วันพ้นราชการ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`dateLeave\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`leaveReason\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`isLeave\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`dateLeave\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`leaveReason\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`isLeave\``); - } - -} diff --git a/src/migration/1717728028260-update_table_Profileemp_add_group.ts b/src/migration/1717728028260-update_table_Profileemp_add_group.ts deleted file mode 100644 index a31ac366..00000000 --- a/src/migration/1717728028260-update_table_Profileemp_add_group.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileempAddGroup1717728028260 implements MigrationInterface { - name = 'UpdateTableProfileempAddGroup1717728028260' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionEmployeeGroupId\` varchar(255) NULL COMMENT 'กลุ่มงาน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionEmployeeLineId\` varchar(255) NULL COMMENT 'สายงาน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionEmployeePositionId\` varchar(255) NULL COMMENT 'ชื่อตำแหน่งทางสายงาน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeOc\` varchar(255) NULL COMMENT 'สังกัด'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeTypeIndividual\` varchar(255) NULL COMMENT 'ประเภทบุคคล'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeWage\` varchar(255) NULL COMMENT 'ค่าจ้าง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeMoneyIncrease\` varchar(255) NULL COMMENT 'เงินเพิ่มการครองชีพชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeMoneyAllowance\` varchar(255) NULL COMMENT 'เงินช่วยเหลือการครองชีพชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeMoneyEmployee\` varchar(255) NULL COMMENT 'เงินสมทบประกันสังคม(ลูกจ้าง)'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeMoneyEmployer\` varchar(255) NULL COMMENT 'เงินสมทบประกันสังคม(นายจ้าง)'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionEmployeeGroupId\` varchar(255) NULL COMMENT 'กลุ่มงาน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionEmployeeLineId\` varchar(255) NULL COMMENT 'สายงาน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionEmployeePositionId\` varchar(255) NULL COMMENT 'ชื่อตำแหน่งทางสายงาน'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeOc\` varchar(255) NULL COMMENT 'สังกัด'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeTypeIndividual\` varchar(255) NULL COMMENT 'ประเภทบุคคล'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeWage\` varchar(255) NULL COMMENT 'ค่าจ้าง'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeMoneyIncrease\` varchar(255) NULL COMMENT 'เงินเพิ่มการครองชีพชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeMoneyAllowance\` varchar(255) NULL COMMENT 'เงินช่วยเหลือการครองชีพชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeMoneyEmployee\` varchar(255) NULL COMMENT 'เงินสมทบประกันสังคม(ลูกจ้าง)'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeMoneyEmployer\` varchar(255) NULL COMMENT 'เงินสมทบประกันสังคม(นายจ้าง)'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` CHANGE \`statusTemp\` \`statusTemp\` varchar(255) NULL COMMENT 'สถานะลูกจ้างชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` CHANGE \`statusTemp\` \`statusTemp\` varchar(255) NULL COMMENT 'สถานะลูกจ้างชั่วคราว'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` CHANGE \`statusTemp\` \`statusTemp\` varchar(255) NULL COMMENT 'สถานะลูกจ่างชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` CHANGE \`statusTemp\` \`statusTemp\` varchar(255) NULL COMMENT 'สถานะลูกจ่างชั่วคราว'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeMoneyEmployer\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeMoneyEmployee\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeMoneyAllowance\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeMoneyIncrease\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeWage\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeTypeIndividual\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeOc\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionEmployeePositionId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionEmployeeLineId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionEmployeeGroupId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeMoneyEmployer\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeMoneyEmployee\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeMoneyAllowance\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeMoneyIncrease\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeWage\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeTypeIndividual\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeOc\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionEmployeePositionId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionEmployeeLineId\``); - await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionEmployeeGroupId\``); - } - -} diff --git a/src/migration/1717732414982-update_table_Profileemp_add_group1.ts b/src/migration/1717732414982-update_table_Profileemp_add_group1.ts deleted file mode 100644 index 773fd45c..00000000 --- a/src/migration/1717732414982-update_table_Profileemp_add_group1.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileempAddGroup11717732414982 implements MigrationInterface { - name = 'UpdateTableProfileempAddGroup11717732414982' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE \`profileEmployeeInformationHistory\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`positionEmployeeGroupId\` varchar(255) NULL COMMENT 'กลุ่มงาน', \`positionEmployeeLineId\` varchar(255) NULL COMMENT 'สายงาน', \`positionEmployeePositionId\` varchar(255) NULL COMMENT 'ชื่อตำแหน่งทางสายงาน', \`employeeOc\` varchar(255) NULL COMMENT 'สังกัด', \`employeeTypeIndividual\` varchar(255) NULL COMMENT 'ประเภทบุคคล', \`employeeWage\` varchar(255) NULL COMMENT 'ค่าจ้าง', \`employeeMoneyIncrease\` varchar(255) NULL COMMENT 'เงินเพิ่มการครองชีพชั่วคราว', \`employeeMoneyAllowance\` varchar(255) NULL COMMENT 'เงินช่วยเหลือการครองชีพชั่วคราว', \`employeeMoneyEmployee\` varchar(255) NULL COMMENT 'เงินสมทบประกันสังคม(ลูกจ้าง)', \`employeeMoneyEmployer\` varchar(255) NULL COMMENT 'เงินสมทบประกันสังคม(นายจ้าง)', \`profileEmployeeId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ProfileEmployee', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`profileEmployeeEmployment\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่จ้าง', \`command\` varchar(255) NULL COMMENT 'คำสั่งจ้าง', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`profileEmployeeEmploymentHistory\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่จ้าง', \`command\` varchar(255) NULL COMMENT 'คำสั่งจ้าง', \`profileEmployeeEmploymentId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ProfileEmployeeEmployment', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeInformationHistory\` ADD CONSTRAINT \`FK_83fb1847aac8764cf663ba22deb\` FOREIGN KEY (\`profileEmployeeId\`) REFERENCES \`profileEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeEmploymentHistory\` ADD CONSTRAINT \`FK_70701d021ef74fdd16fd72065e2\` FOREIGN KEY (\`profileEmployeeEmploymentId\`) REFERENCES \`profileEmployeeEmployment\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeEmploymentHistory\` DROP FOREIGN KEY \`FK_70701d021ef74fdd16fd72065e2\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeInformationHistory\` DROP FOREIGN KEY \`FK_83fb1847aac8764cf663ba22deb\``); - await queryRunner.query(`DROP TABLE \`profileEmployeeEmploymentHistory\``); - await queryRunner.query(`DROP TABLE \`profileEmployeeEmployment\``); - await queryRunner.query(`DROP TABLE \`profileEmployeeInformationHistory\``); - } - -} diff --git a/src/migration/1717741744850-update_table_Profileemp_add_group2.ts b/src/migration/1717741744850-update_table_Profileemp_add_group2.ts deleted file mode 100644 index ddc4f984..00000000 --- a/src/migration/1717741744850-update_table_Profileemp_add_group2.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileempAddGroup21717741744850 implements MigrationInterface { - name = 'UpdateTableProfileempAddGroup21717741744850' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` ADD \`profileEmployeeId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ProfileEmployee'`); - await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` ADD CONSTRAINT \`FK_229d969d15790aae298399f9303\` FOREIGN KEY (\`profileEmployeeId\`) REFERENCES \`profileEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` DROP FOREIGN KEY \`FK_229d969d15790aae298399f9303\``); - await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` DROP COLUMN \`profileEmployeeId\``); - } - -} diff --git a/src/migration/1718080059633-update_table_Profileemp_add_role.ts b/src/migration/1718080059633-update_table_Profileemp_add_role.ts deleted file mode 100644 index 844ed916..00000000 --- a/src/migration/1718080059633-update_table_Profileemp_add_role.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileempAddRole1718080059633 implements MigrationInterface { - name = 'UpdateTableProfileempAddRole1718080059633' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE \`AuthRole\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`roleName\` varchar(255) NULL COMMENT 'ชื่อบทบาท', \`roleDescription\` varchar(255) NULL COMMENT 'รายละเอียด', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`AuthRoleAttr\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`attrOwnership\` varchar(255) NULL, \`attrIsCreate\` tinyint NOT NULL DEFAULT 0, \`attrIsList\` tinyint NOT NULL DEFAULT 0, \`attrIsGet\` tinyint NOT NULL DEFAULT 0, \`attrIsUpdate\` tinyint NOT NULL DEFAULT 0, \`attrIsDelete\` tinyint NOT NULL DEFAULT 0, \`attrPrivilege\` varchar(255) NULL, \`authRoleId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง AuthRole', \`authSysId\` varchar(255) NULL COMMENT 'คีย์นอก(FK)ของตาราง AuthSys', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`AuthSys\` (\`id\` varchar(255) NOT NULL COMMENT 'ไอดีหลักของตาราง', \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`sysName\` varchar(255) NULL COMMENT 'ชื่อระบบ', \`sysDescription\` varchar(255) NULL COMMENT 'รายละเอียด', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`ALTER TABLE \`AuthRoleAttr\` ADD CONSTRAINT \`FK_11aa85dc9e4d0cf790bdde5613e\` FOREIGN KEY (\`authSysId\`) REFERENCES \`AuthSys\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`AuthRoleAttr\` ADD CONSTRAINT \`FK_71e41aa6a8400ba965ee323489d\` FOREIGN KEY (\`authRoleId\`) REFERENCES \`AuthRole\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`AuthRoleAttr\` DROP FOREIGN KEY \`FK_71e41aa6a8400ba965ee323489d\``); - await queryRunner.query(`ALTER TABLE \`AuthRoleAttr\` DROP FOREIGN KEY \`FK_11aa85dc9e4d0cf790bdde5613e\``); - await queryRunner.query(`DROP TABLE \`AuthSys\``); - await queryRunner.query(`DROP TABLE \`AuthRoleAttr\``); - await queryRunner.query(`DROP TABLE \`AuthRole\``); - } - -} diff --git a/src/migration/1718089860221-update_table_Profileemp_add_role1.ts b/src/migration/1718089860221-update_table_Profileemp_add_role1.ts deleted file mode 100644 index 1bbbffb6..00000000 --- a/src/migration/1718089860221-update_table_Profileemp_add_role1.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileempAddRole11718089860221 implements MigrationInterface { - name = 'UpdateTableProfileempAddRole11718089860221' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE \`authSys\` (\`id\` varchar(255) NOT NULL COMMENT 'ไอดีหลักของตาราง', \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`sysName\` varchar(255) NULL COMMENT 'ชื่อระบบ', \`sysDescription\` varchar(255) NULL COMMENT 'รายละเอียด', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`authRole\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`roleName\` varchar(255) NULL COMMENT 'ชื่อบทบาท', \`roleDescription\` varchar(255) NULL COMMENT 'รายละเอียด', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`authRoleAttr\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`attrOwnership\` varchar(255) NULL, \`attrIsCreate\` tinyint NOT NULL DEFAULT 0, \`attrIsList\` tinyint NOT NULL DEFAULT 0, \`attrIsGet\` tinyint NOT NULL DEFAULT 0, \`attrIsUpdate\` tinyint NOT NULL DEFAULT 0, \`attrIsDelete\` tinyint NOT NULL DEFAULT 0, \`attrPrivilege\` varchar(255) NULL, \`authRoleId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง AuthRole', \`authSysId\` varchar(255) NULL COMMENT 'คีย์นอก(FK)ของตาราง AuthSys', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` ADD CONSTRAINT \`FK_b5b59c60792d518f4f025379dba\` FOREIGN KEY (\`authSysId\`) REFERENCES \`authSys\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` ADD CONSTRAINT \`FK_c50907c64fce7ed8f2fb68a3d50\` FOREIGN KEY (\`authRoleId\`) REFERENCES \`authRole\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` DROP FOREIGN KEY \`FK_c50907c64fce7ed8f2fb68a3d50\``); - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` DROP FOREIGN KEY \`FK_b5b59c60792d518f4f025379dba\``); - await queryRunner.query(`DROP TABLE \`authRoleAttr\``); - await queryRunner.query(`DROP TABLE \`authRole\``); - await queryRunner.query(`DROP TABLE \`authSys\``); - } - -} diff --git a/src/migration/1718097497764-add_table_change_position.ts b/src/migration/1718097497764-add_table_change_position.ts deleted file mode 100644 index ee44c7fa..00000000 --- a/src/migration/1718097497764-add_table_change_position.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class AddTableChangePosition1718097497764 implements MigrationInterface { - name = 'AddTableChangePosition1718097497764' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE \`changePosition\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`name\` text NULL COMMENT 'ชื่อรอบการย้ายสับเปลี่ยนตำแหน่ง', \`date\` datetime NULL COMMENT 'วันที่ดำเนินการ', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`CREATE TABLE \`profileChangePosition\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`reason\` text NULL COMMENT 'เหตุผลที่รับโอนราชการ', \`educationOld\` varchar(255) NULL COMMENT 'วุฒิ/สาขาเดิม', \`organizationPositionOld\` varchar(255) NULL COMMENT 'สังกัดเดิม', \`organizationOld\` varchar(255) NULL COMMENT 'สังกัดเดิม', \`positionOld\` varchar(255) NULL COMMENT 'ตำแหน่งเดิม', \`positionTypeOld\` varchar(255) NULL COMMENT 'ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท', \`positionLevelOld\` varchar(255) NULL COMMENT 'ข้อมูลหน่วยงานเดิม ระดับ', \`positionNumberOld\` varchar(255) NULL COMMENT 'ข้อมูลหน่วยงานเดิม เลขที่', \`amountOld\` double NULL COMMENT 'ข้อมูลหน่วยงานเดิม เงินเดือน', \`profileId\` varchar(255) NULL COMMENT 'profile Id', \`prefix\` varchar(255) NULL COMMENT 'คำนำหน้า', \`firstName\` varchar(255) NULL COMMENT 'ชื่อ', \`lastName\` varchar(255) NULL COMMENT 'นามสกุล', \`citizenId\` varchar(255) NULL COMMENT 'เลขบัตรประชาชน', \`root\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน root', \`rootId\` varchar(255) NULL COMMENT 'id หน่วยงาน root', \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน root', \`child1\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child1', \`child1Id\` varchar(255) NULL COMMENT 'id หน่วยงาน child1', \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child1', \`child2\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child2', \`child2Id\` varchar(255) NULL COMMENT 'id หน่วยงาน child2', \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child2', \`child3\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child3', \`child3Id\` varchar(255) NULL COMMENT 'id หน่วยงาน child3', \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child3', \`child4\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child4', \`child4Id\` varchar(255) NULL COMMENT 'id หน่วยงาน child4', \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child4', \`node\` int NULL COMMENT 'ระดับโครงสร้าง', \`nodeId\` varchar(255) NULL COMMENT 'id โครงสร้าง', \`posmasterId\` varchar(255) NULL COMMENT 'id อัตรากำลัง', \`orgRevisionId\` varchar(255) NULL COMMENT 'id revision', \`positionId\` varchar(255) NULL COMMENT 'id ตำแหน่ง', \`positionField\` varchar(255) NULL COMMENT 'สายงาน', \`posMasterNo\` int NULL COMMENT 'เลขที่ตำแหน่ง', \`position\` varchar(255) NULL COMMENT 'ชื่อตำแหน่งในสายงาน', \`posTypeId\` varchar(255) NULL COMMENT 'id ประเภทตำแหน่ง', \`posTypeName\` varchar(255) NULL COMMENT 'ชื่อประเภทตำแหน่ง', \`posLevelId\` varchar(255) NULL COMMENT 'id ระดับตำแหน่ง', \`posLevelName\` varchar(255) NULL COMMENT 'ชื่อระดับตำแหน่ง', \`rootOld\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน root old', \`rootOldId\` varchar(255) NULL COMMENT 'id หน่วยงาน root old', \`rootShortNameOld\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน root old', \`child1Old\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child1 old', \`child1OldId\` varchar(255) NULL COMMENT 'id หน่วยงาน child1 old', \`child1ShortNameOld\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child1 old', \`child2Old\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child2 old', \`child2OldId\` varchar(255) NULL COMMENT 'id หน่วยงาน child2 old', \`child2ShortNameOld\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child2 old', \`child3Old\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child3 old', \`child3OldId\` varchar(255) NULL COMMENT 'id หน่วยงาน child3 old', \`child3ShortNameOld\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child3 old', \`child4Old\` varchar(255) NULL COMMENT 'ชื่อหน่วยงาน child4 old', \`child4OldId\` varchar(255) NULL COMMENT 'id หน่วยงาน child4 old', \`child4ShortNameOld\` varchar(255) NULL COMMENT 'ชื่อย่อหน่วยงาน child4 old', \`posMasterNoOld\` int NULL COMMENT 'เลขที่ตำแหน่ง old', \`posTypeOldId\` varchar(255) NULL COMMENT 'id ประเภทตำแหน่ง old', \`posTypeNameOld\` varchar(255) NULL COMMENT 'ชื่อประเภทตำแหน่ง old', \`posLevelOldId\` varchar(255) NULL COMMENT 'id ระดับตำแหน่ง old', \`posLevelNameOld\` varchar(255) NULL COMMENT 'ชื่อระดับตำแหน่ง old', \`changePositionId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ChangePosition', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` ADD CONSTRAINT \`FK_91b13ee34e6af4bee74771d17e8\` FOREIGN KEY (\`changePositionId\`) REFERENCES \`changePosition\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` DROP FOREIGN KEY \`FK_91b13ee34e6af4bee74771d17e8\``); - await queryRunner.query(`DROP TABLE \`profileChangePosition\``); - await queryRunner.query(`DROP TABLE \`changePosition\``); - } - -} diff --git a/src/migration/1718098502267-update_table_Profileemp_add_role2.ts b/src/migration/1718098502267-update_table_Profileemp_add_role2.ts deleted file mode 100644 index 07289e9b..00000000 --- a/src/migration/1718098502267-update_table_Profileemp_add_role2.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfileempAddRole21718098502267 implements MigrationInterface { - name = 'UpdateTableProfileempAddRole21718098502267' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`changePosition\` ADD \`status\` text NULL COMMENT 'สถานะ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`changePosition\` DROP COLUMN \`status\``); - } - -} diff --git a/src/migration/1718163843179-update_table_role_add_node.ts b/src/migration/1718163843179-update_table_role_add_node.ts deleted file mode 100644 index 8f20c2a7..00000000 --- a/src/migration/1718163843179-update_table_role_add_node.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableRoleAddNode1718163843179 implements MigrationInterface { - name = 'UpdateTableRoleAddNode1718163843179' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` ADD \`isDirector\` tinyint NOT NULL COMMENT 'เป็นผู้อำนวยการ' DEFAULT 0`); - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นเจ้าหน้าที่' DEFAULT 0`); - await queryRunner.query(`ALTER TABLE \`posMaster\` ADD \`isDirector\` tinyint NOT NULL COMMENT 'เป็นผู้อำนวยการ' DEFAULT 0`); - await queryRunner.query(`ALTER TABLE \`posMaster\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นเจ้าหน้าที่' DEFAULT 0`); - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` ADD \`parentNode\` varchar(255) NULL COMMENT 'Root'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` DROP COLUMN \`parentNode\``); - await queryRunner.query(`ALTER TABLE \`posMaster\` DROP COLUMN \`isOfficer\``); - await queryRunner.query(`ALTER TABLE \`posMaster\` DROP COLUMN \`isDirector\``); - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` DROP COLUMN \`isOfficer\``); - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` DROP COLUMN \`isDirector\``); - } - -} diff --git a/src/migration/1718165907865-update_table_role_add_node1.ts b/src/migration/1718165907865-update_table_role_add_node1.ts deleted file mode 100644 index 47182165..00000000 --- a/src/migration/1718165907865-update_table_role_add_node1.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableRoleAddNode11718165907865 implements MigrationInterface { - name = 'UpdateTableRoleAddNode11718165907865' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` DROP FOREIGN KEY \`FK_b5b59c60792d518f4f025379dba\``); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`authRoleAttr\` ADD CONSTRAINT \`FK_b5b59c60792d518f4f025379dba\` FOREIGN KEY (\`authSysId\`) REFERENCES \`authSys\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - -} diff --git a/src/migration/1718173589821-update_table_role_add_sys.ts b/src/migration/1718173589821-update_table_role_add_sys.ts deleted file mode 100644 index 06306bc3..00000000 --- a/src/migration/1718173589821-update_table_role_add_sys.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableRoleAddSys1718173589821 implements MigrationInterface { - name = 'UpdateTableRoleAddSys1718173589821' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`DROP INDEX \`FK_b5b59c60792d518f4f025379dba\` ON \`authRoleAttr\``); - await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`parentId\` varchar(255) NULL COMMENT 'Id ของเมนูหลักถ้าเป็นเมนูหลักจะเป็นค่า null'`); - await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`icon\` varchar(100) NULL COMMENT 'ชื่อ icon'`); - await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`path\` varchar(255) NULL COMMENT 'path url ของระบบ'`); - await queryRunner.query(`ALTER TABLE \`authSys\` ADD \`order\` int NOT NULL COMMENT 'ลำดับการแสดงผล' DEFAULT '0'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`order\``); - await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`path\``); - await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`icon\``); - await queryRunner.query(`ALTER TABLE \`authSys\` DROP COLUMN \`parentId\``); - await queryRunner.query(`CREATE INDEX \`FK_b5b59c60792d518f4f025379dba\` ON \`authRoleAttr\` (\`authSysId\`)`); - } - -} diff --git a/src/migration/1718176873613-update_table_role_add_sys1.ts b/src/migration/1718176873613-update_table_role_add_sys1.ts deleted file mode 100644 index bb163097..00000000 --- a/src/migration/1718176873613-update_table_role_add_sys1.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableRoleAddSys11718176873613 implements MigrationInterface { - name = 'UpdateTableRoleAddSys11718176873613' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` ADD \`status\` text NULL COMMENT 'สถานะ'`); - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` CHANGE \`organizationPositionOld\` \`organizationPositionOld\` varchar(255) NULL COMMENT 'สังกัดเดิม ตำแหน่ง'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` CHANGE \`organizationPositionOld\` \`organizationPositionOld\` varchar(255) NULL COMMENT 'สังกัดเดิม'`); - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` DROP COLUMN \`status\``); - } - -} diff --git a/src/migration/1718188662070-update_table_profilechage_add_birthdate.ts b/src/migration/1718188662070-update_table_profilechage_add_birthdate.ts deleted file mode 100644 index 545d13c6..00000000 --- a/src/migration/1718188662070-update_table_profilechage_add_birthdate.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfilechageAddBirthdate1718188662070 implements MigrationInterface { - name = 'UpdateTableProfilechageAddBirthdate1718188662070' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` ADD \`birthDate\` datetime NULL COMMENT 'วันเกิด'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` DROP COLUMN \`birthDate\``); - } - -} diff --git a/src/migration/1718248767175-update_table_profilechange_add_current.ts b/src/migration/1718248767175-update_table_profilechange_add_current.ts deleted file mode 100644 index 05b38d4a..00000000 --- a/src/migration/1718248767175-update_table_profilechange_add_current.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableProfilechangeAddCurrent1718248767175 implements MigrationInterface { - name = 'UpdateTableProfilechangeAddCurrent1718248767175' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` ADD \`dateCurrent\` datetime NULL COMMENT 'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`profileChangePosition\` DROP COLUMN \`dateCurrent\``); - } - -} diff --git a/src/migration/1718350999556-update_table_posmaster_add_role5.ts b/src/migration/1718350999556-update_table_posmaster_add_role5.ts deleted file mode 100644 index 24747771..00000000 --- a/src/migration/1718350999556-update_table_posmaster_add_role5.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTablePosmasterAddRole51718350999556 implements MigrationInterface { - name = 'UpdateTablePosmasterAddRole51718350999556' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` ADD \`authRoleId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง authRole'`); - await queryRunner.query(`ALTER TABLE \`posMaster\` ADD \`authRoleId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง authRole'`); - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` ADD CONSTRAINT \`FK_388ecc9f2a9f5b5ff1e08fd6d0e\` FOREIGN KEY (\`authRoleId\`) REFERENCES \`authRole\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`posMaster\` ADD CONSTRAINT \`FK_a059796d095e79ba5b20407859f\` FOREIGN KEY (\`authRoleId\`) REFERENCES \`authRole\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`posMaster\` DROP FOREIGN KEY \`FK_a059796d095e79ba5b20407859f\``); - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` DROP FOREIGN KEY \`FK_388ecc9f2a9f5b5ff1e08fd6d0e\``); - await queryRunner.query(`ALTER TABLE \`posMaster\` DROP COLUMN \`authRoleId\``); - await queryRunner.query(`ALTER TABLE \`employeePosMaster\` DROP COLUMN \`authRoleId\``); - } - -} diff --git a/src/migration/1718807439080-update_table_kpi_add_summary1.ts b/src/migration/1718807439080-update_table_kpi_add_summary1.ts deleted file mode 100644 index 0f04d1a9..00000000 --- a/src/migration/1718807439080-update_table_kpi_add_summary1.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class UpdateTableKpiAddSummary11718807439080 implements MigrationInterface { - name = 'UpdateTableKpiAddSummary11718807439080' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE \`posMasterAct\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`posMasterOrder\` int NULL COMMENT 'ลำดับที่แสดงผล', \`posMasterId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง posMaster', \`posMasterChildId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง posMasterChild', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); - await queryRunner.query(`ALTER TABLE \`posMasterAct\` ADD CONSTRAINT \`FK_ef186d66137edc512471eaef51b\` FOREIGN KEY (\`posMasterId\`) REFERENCES \`posMaster\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE \`posMasterAct\` ADD CONSTRAINT \`FK_0f07f317c0771dadcdac1f71a6d\` FOREIGN KEY (\`posMasterChildId\`) REFERENCES \`posMaster\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE \`posMasterAct\` DROP FOREIGN KEY \`FK_0f07f317c0771dadcdac1f71a6d\``); - await queryRunner.query(`ALTER TABLE \`posMasterAct\` DROP FOREIGN KEY \`FK_ef186d66137edc512471eaef51b\``); - await queryRunner.query(`DROP TABLE \`posMasterAct\``); - } - -}