commit for pushing in holding repo
This commit is contained in:
17
src/migrations/1763476513917-add-fields-to-blogs.ts
Normal file
17
src/migrations/1763476513917-add-fields-to-blogs.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
|
||||
|
||||
export class AddFieldsToBlogs1763476513917 implements MigrationInterface {
|
||||
name = "AddFieldsToBlogs1763476513917";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.addColumns("blogs", [
|
||||
new TableColumn({ name: "featuredImage", type: "varchar", isNullable: true }),
|
||||
new TableColumn({ name: "gallery", type: "jsonb", isNullable: true, default: "'[]'::jsonb" }),
|
||||
new TableColumn({ name: "publishedAt", type: "timestamp", isNullable: true, default: null }),
|
||||
]);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.dropColumns("blogs", ["featuredImage", "gallery", "publishedAt"]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user