3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 23:09:59 +00:00
zeppelin/backend/src/migrations/1575230079526-AddRepeatColumnsToScheduledPosts.ts
2019-12-01 23:23:34 +02:00

31 lines
966 B
TypeScript

import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
export class AddRepeatColumnsToScheduledPosts1575230079526 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.addColumns("scheduled_posts", [
new TableColumn({
name: "repeat_interval",
type: "integer",
unsigned: true,
isNullable: true,
}),
new TableColumn({
name: "repeat_until",
type: "datetime",
isNullable: true,
}),
new TableColumn({
name: "repeat_times",
type: "integer",
unsigned: true,
isNullable: true,
}),
]);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropColumn("scheduled_posts", "repeat_interval");
await queryRunner.dropColumn("scheduled_posts", "repeat_until");
await queryRunner.dropColumn("scheduled_posts", "repeat_times");
}
}