migrate
This commit is contained in:
parent
2584d26d6c
commit
bd9b8b4183
1 changed files with 20 additions and 0 deletions
20
src/migration/1716270845115-update_table_dev_reason_text.ts
Normal file
20
src/migration/1716270845115-update_table_dev_reason_text.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableDevReasonText1716270845115 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableDevReasonText1716270845115'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`reason\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`reason\` text NULL COMMENT 'หลักการและเหตุผล'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`objective\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`objective\` text NULL COMMENT 'วัตถุประสงค์'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`objective\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`objective\` varchar(255) NULL COMMENT 'วัตถุประสงค์'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`reason\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`reason\` varchar(255) NULL COMMENT 'หลักการและเหตุผล'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue