migration
This commit is contained in:
parent
b1a9c77c8c
commit
6cc6bed806
2 changed files with 23 additions and 3 deletions
|
|
@ -6,17 +6,17 @@ import { ApiName } from "./ApiName";
|
||||||
@Entity("apiHistory")
|
@Entity("apiHistory")
|
||||||
export class ApiHistory extends EntityBase {
|
export class ApiHistory extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
|
type: 'longtext',
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "header",
|
comment: "header",
|
||||||
length: 255,
|
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
headerApi: string;
|
headerApi: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
|
type: 'longtext',
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "token",
|
comment: "token",
|
||||||
length: 255,
|
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
tokenApi: string;
|
tokenApi: string;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateSizeHeaderApiAndTokenApiFieldApiHistoryTable1762243747843 implements MigrationInterface {
|
||||||
|
name = 'UpdateSizeHeaderApiAndTokenApiFieldApiHistoryTable1762243747843'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`headerApi\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`headerApi\` longtext NULL COMMENT 'header'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`tokenApi\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`tokenApi\` longtext NULL COMMENT 'token'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`tokenApi\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`tokenApi\` varchar(255) NULL COMMENT 'token'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` DROP COLUMN \`headerApi\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`apiHistory\` ADD \`headerApi\` varchar(255) NULL COMMENT 'header'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue