From 978f92a1c589ac404a3cb1103a68a8a5ffb0dd7d Mon Sep 17 00:00:00 2001 From: sct Date: Wed, 11 Nov 2020 09:06:42 +0000 Subject: [PATCH] feat: season creation migration --- server/migration/1605085519544-SeasonStatus.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 server/migration/1605085519544-SeasonStatus.ts diff --git a/server/migration/1605085519544-SeasonStatus.ts b/server/migration/1605085519544-SeasonStatus.ts new file mode 100644 index 000000000..bcff6f609 --- /dev/null +++ b/server/migration/1605085519544-SeasonStatus.ts @@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class SeasonStatus1605085519544 implements MigrationInterface { + name = 'SeasonStatus1605085519544'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TABLE "season" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "seasonNumber" integer NOT NULL, "status" integer NOT NULL DEFAULT (1), "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "mediaId" integer)` + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE "season"`); + } +}