diff --git a/src/controllers/ChangePositionController.ts b/src/controllers/ChangePositionController.ts index 0d604c61..b9e0dbc4 100644 --- a/src/controllers/ChangePositionController.ts +++ b/src/controllers/ChangePositionController.ts @@ -24,7 +24,7 @@ import { Equal, ILike, In, IsNull, Like, Not, Brackets, MoreThan } from "typeorm import { RequestWithUser } from "../middlewares/user"; import { ChangePosition, CreateChangePosition, UpdateChangePosition } from "../entities/ChangePosition"; -@Route("api/v1/placement/change-position") +@Route("api/v1/org/placement/change-position") @Tags("Placement") @Security("bearerAuth") @Response( diff --git a/src/entities/AuthRoleAttr.ts b/src/entities/AuthRoleAttr.ts index 401c5d76..93948494 100644 --- a/src/entities/AuthRoleAttr.ts +++ b/src/entities/AuthRoleAttr.ts @@ -73,7 +73,7 @@ export class AuthRoleAttr extends EntityBase { comment: "Root", default: null, }) - parentNode?: string | null; + parentNode?: string; @ManyToOne(() => AuthSys, (authSys) => authSys.authSys) @JoinColumn({ name: "authSysId" }) diff --git a/src/migration/1718163843179-update_table_role_add_node.ts b/src/migration/1718163843179-update_table_role_add_node.ts new file mode 100644 index 00000000..8f20c2a7 --- /dev/null +++ b/src/migration/1718163843179-update_table_role_add_node.ts @@ -0,0 +1,22 @@ +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\``); + } + +}