migration

This commit is contained in:
Adisak 2025-11-03 15:57:41 +07:00
parent 39a1a3bbb0
commit 19d665fd69
4 changed files with 36 additions and 3 deletions

View file

@ -14,9 +14,9 @@ export class ApiKey extends EntityBase {
name: string;
@Column({
type: 'longtext',
nullable: true,
comment: "keyApi",
length: 255,
default: null,
})
keyApi: string;

View file

@ -55,9 +55,9 @@ export class ProfileTraining extends EntityBase {
topic: string;
@Column({
type: 'longtext',
nullable: true,
length: 200,
comment: "สถานที่ฝึกอบรม/ดูงาน ",
comment: "สถานที่ฝึกอบรม/ดูงาน",
default: null,
})
place: string;

View 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'`);
}
}

View 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 'สถานที่ฝึกอบรม/ดูงาน '`);
}
}