migrate
This commit is contained in:
parent
2e2a4336c1
commit
fdd9c510cc
1 changed files with 16 additions and 0 deletions
16
src/migration/1720165194013-update_field.ts
Normal file
16
src/migration/1720165194013-update_field.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateField1720165194013 implements MigrationInterface {
|
||||||
|
name = 'UpdateField1720165194013'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`portfolio\` DROP COLUMN \`detail\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`portfolio\` ADD \`detail\` longtext NULL COMMENT 'รายละเอียดเอกสาร/ผลงาน'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`portfolio\` DROP COLUMN \`detail\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`portfolio\` ADD \`detail\` varchar(255) NULL COMMENT 'รายละเอียดเอกสาร/ผลงาน'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue