diff --git a/src/controllers/EducationLevelController.ts b/src/controllers/EducationLevelController.ts index 67da2294..a4e87734 100644 --- a/src/controllers/EducationLevelController.ts +++ b/src/controllers/EducationLevelController.ts @@ -157,7 +157,7 @@ export class EducationLevelController extends Controller { "createdFullName", "lastUpdateFullName", ], - order: { createdAt: "ASC" }, + order: { rank: "ASC" }, }); // if (!educationLevel) { diff --git a/src/migration/1715662524792-update_table_profileemployee_add_pk5.ts b/src/migration/1715662524792-update_table_profileemployee_add_pk5.ts new file mode 100644 index 00000000..8ab25ed3 --- /dev/null +++ b/src/migration/1715662524792-update_table_profileemployee_add_pk5.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileemployeeAddPk51715662524792 implements MigrationInterface { + name = 'UpdateTableProfileemployeeAddPk51715662524792' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD \`profileEmployeeId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ProfileEmployee'`); + await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD CONSTRAINT \`FK_f5758428d496b6d2a051c8af92b\` 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 \`profileSalary\` DROP FOREIGN KEY \`FK_f5758428d496b6d2a051c8af92b\``); + await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP COLUMN \`profileEmployeeId\``); + } + +}