hrms-api-development/src/migration/1712135296648-update_table_development_add_dateStudyStart1.ts
2024-04-03 16:14:00 +07:00

16 lines
1,015 B
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableDevelopmentAddDateStudyStart11712135296648 implements MigrationInterface {
name = 'UpdateTableDevelopmentAddDateStudyStart11712135296648'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP COLUMN \`dateOrder\``);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD \`dateOrder\` datetime NULL COMMENT 'คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP COLUMN \`dateOrder\``);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD \`dateOrder\` varchar(255) NULL COMMENT 'คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่'`);
}
}