migration
This commit is contained in:
parent
39a1a3bbb0
commit
19d665fd69
4 changed files with 36 additions and 3 deletions
17
src/migration/1762159481993-update_size_keyapi_field.ts
Normal file
17
src/migration/1762159481993-update_size_keyapi_field.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateSizeKeyapiField1762159481993 implements MigrationInterface {
|
||||
name = 'UpdateSizeKeyapiField1762159481993'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`apiKey\` DROP COLUMN \`keyApi\``);
|
||||
await queryRunner.query(`ALTER TABLE \`apiKey\` ADD \`keyApi\` longtext NULL COMMENT 'keyApi'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`apiKey\` DROP COLUMN \`keyApi\``);
|
||||
await queryRunner.query(`ALTER TABLE \`apiKey\` ADD \`keyApi\` varchar(255) NULL COMMENT 'keyApi'`);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
16
src/migration/1762159824907-update_size_place_field.ts
Normal file
16
src/migration/1762159824907-update_size_place_field.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateSizePlaceField1762159824907 implements MigrationInterface {
|
||||
name = 'UpdateSizePlaceField1762159824907'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileTraining\` DROP COLUMN \`place\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileTraining\` ADD \`place\` longtext NULL COMMENT 'สถานที่ฝึกอบรม/ดูงาน'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileTraining\` DROP COLUMN \`place\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileTraining\` ADD \`place\` varchar(200) NULL COMMENT 'สถานที่ฝึกอบรม/ดูงาน '`);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue