Add repeat options for scheduled posts

This commit is contained in:
Dragory 2019-12-01 23:23:34 +02:00
parent 646156344a
commit 2ff65e89fd
7 changed files with 320 additions and 113 deletions

View file

@ -0,0 +1,31 @@
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");
}
}