18 lines
707 B
TypeScript
18 lines
707 B
TypeScript
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
|
|
|
|
export class RemoveFieldsFromBlogs1763401913367 implements MigrationInterface {
|
|
name = "RemoveFieldsFromBlogs1763401913367";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.dropColumns("blogs", ["title", "description", "editor"]);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.addColumns("blogs", [
|
|
new TableColumn({ name: "title", type: "varchar", isNullable: false }),
|
|
new TableColumn({ name: "description", type: "varchar", isNullable: false }),
|
|
new TableColumn({ name: "editor", type: "jsonb", isNullable: false }),
|
|
]);
|
|
}
|
|
}
|