เงินเดือนไม่มีค่าให้เป็นnull

This commit is contained in:
Kittapath 2024-02-29 14:07:27 +07:00
parent 6791dde26f
commit 0888d3d8d8
3 changed files with 30 additions and 15 deletions

View file

@ -0,0 +1,18 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableSalaryProfileAddIsretired11709189881087 implements MigrationInterface {
name = 'UpdateTableSalaryProfileAddIsretired11709189881087'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountSpecial\` \`amountSpecial\` double NOT NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountUse\` \`amountUse\` double NOT NULL COMMENT 'จำนวนเงินที่ใช้เลื่อน' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`positionSalaryAmount\` \`positionSalaryAmount\` double NOT NULL COMMENT 'เงินเดือนหลังเลื่อน' DEFAULT '0'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`positionSalaryAmount\` \`positionSalaryAmount\` double NULL COMMENT 'เงินเดือนหลังเลื่อน'`);
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountUse\` \`amountUse\` double NULL COMMENT 'จำนวนเงินที่ใช้เลื่อน'`);
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountSpecial\` \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ'`);
}
}