From bfc725f46802c172ffaf0a9a2245807cbb91a166 Mon Sep 17 00:00:00 2001 From: Xeltica Date: Sat, 25 Feb 2023 17:16:34 +0900 Subject: [PATCH] =?UTF-8?q?lint=E3=81=8C=E3=81=86=E3=82=8B=E3=81=95?= =?UTF-8?q?=E3=81=84=E3=82=93=E3=81=98=E3=82=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- migration/1633841235323-announcement.ts | 14 ++++---- migration/1643366857976-addTokenVersion.ts | 14 ++++---- migration/1644940446672-alertModeBoth.ts | 34 +++++++++---------- .../1663226831484-expandTemplateLength.ts | 14 ++++---- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/migration/1633841235323-announcement.ts b/migration/1633841235323-announcement.ts index 6d2c46a..f838b20 100644 --- a/migration/1633841235323-announcement.ts +++ b/migration/1633841235323-announcement.ts @@ -1,14 +1,14 @@ import {MigrationInterface, QueryRunner} from 'typeorm'; export class Announcement1633841235323 implements MigrationInterface { - name = 'Announcement1633841235323' + name = 'Announcement1633841235323'; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query('CREATE TABLE "announcement" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP NOT NULL, "title" character varying(128) NOT NULL, "body" character varying(8192) NOT NULL, "like" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_e0ef0550174fd1099a308fd18a0" PRIMARY KEY ("id"))'); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query('CREATE TABLE "announcement" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP NOT NULL, "title" character varying(128) NOT NULL, "body" character varying(8192) NOT NULL, "like" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_e0ef0550174fd1099a308fd18a0" PRIMARY KEY ("id"))'); + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query('DROP TABLE "announcement"'); - } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query('DROP TABLE "announcement"'); + } } diff --git a/migration/1643366857976-addTokenVersion.ts b/migration/1643366857976-addTokenVersion.ts index 40bb25e..4fb3f25 100644 --- a/migration/1643366857976-addTokenVersion.ts +++ b/migration/1643366857976-addTokenVersion.ts @@ -1,14 +1,14 @@ import {MigrationInterface, QueryRunner} from 'typeorm'; export class addTokenVersion1643366857976 implements MigrationInterface { - name = 'addTokenVersion1643366857976' + name = 'addTokenVersion1643366857976'; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query('ALTER TABLE "user" ADD "tokenVersion" integer NOT NULL DEFAULT 1'); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TABLE "user" ADD "tokenVersion" integer NOT NULL DEFAULT 1'); + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query('ALTER TABLE "user" DROP COLUMN "tokenVersion"'); - } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TABLE "user" DROP COLUMN "tokenVersion"'); + } } diff --git a/migration/1644940446672-alertModeBoth.ts b/migration/1644940446672-alertModeBoth.ts index 98b97a5..43c6696 100644 --- a/migration/1644940446672-alertModeBoth.ts +++ b/migration/1644940446672-alertModeBoth.ts @@ -1,24 +1,24 @@ import {MigrationInterface, QueryRunner} from 'typeorm'; export class alertModeBoth1644940446672 implements MigrationInterface { - name = 'alertModeBoth1644940446672' + name = 'alertModeBoth1644940446672'; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query('ALTER TYPE "public"."user_alertmode_enum" RENAME TO "user_alertmode_enum_old"'); - await queryRunner.query('CREATE TYPE "user_alertmode_enum" AS ENUM(\'note\', \'notification\', \'both\', \'nothing\')'); - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" DROP DEFAULT'); - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" TYPE "user_alertmode_enum" USING "alertMode"::"text"::"user_alertmode_enum"'); - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" SET DEFAULT \'notification\''); - await queryRunner.query('DROP TYPE "user_alertmode_enum_old"'); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TYPE "public"."user_alertmode_enum" RENAME TO "user_alertmode_enum_old"'); + await queryRunner.query('CREATE TYPE "user_alertmode_enum" AS ENUM(\'note\', \'notification\', \'both\', \'nothing\')'); + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" DROP DEFAULT'); + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" TYPE "user_alertmode_enum" USING "alertMode"::"text"::"user_alertmode_enum"'); + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" SET DEFAULT \'notification\''); + await queryRunner.query('DROP TYPE "user_alertmode_enum_old"'); + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query('CREATE TYPE "user_alertmode_enum_old" AS ENUM(\'note\', \'notification\', \'nothing\')'); - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" DROP DEFAULT'); - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" TYPE "user_alertmode_enum_old" USING "alertMode"::"text"::"user_alertmode_enum_old"'); - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" SET DEFAULT \'notification\''); - await queryRunner.query('DROP TYPE "user_alertmode_enum"'); - await queryRunner.query('ALTER TYPE "user_alertmode_enum_old" RENAME TO "user_alertmode_enum"'); - } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query('CREATE TYPE "user_alertmode_enum_old" AS ENUM(\'note\', \'notification\', \'nothing\')'); + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" DROP DEFAULT'); + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" TYPE "user_alertmode_enum_old" USING "alertMode"::"text"::"user_alertmode_enum_old"'); + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "alertMode" SET DEFAULT \'notification\''); + await queryRunner.query('DROP TYPE "user_alertmode_enum"'); + await queryRunner.query('ALTER TYPE "user_alertmode_enum_old" RENAME TO "user_alertmode_enum"'); + } } diff --git a/migration/1663226831484-expandTemplateLength.ts b/migration/1663226831484-expandTemplateLength.ts index b36acd8..dc1846d 100644 --- a/migration/1663226831484-expandTemplateLength.ts +++ b/migration/1663226831484-expandTemplateLength.ts @@ -1,13 +1,13 @@ import {MigrationInterface, QueryRunner} from 'typeorm'; export class expandTemplateLength1663226831484 implements MigrationInterface { - name = 'expandTemplateLength1663226831484' + name = 'expandTemplateLength1663226831484'; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "template" TYPE character varying(1024)'); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "template" TYPE character varying(1024)'); + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "template" TYPE character varying(280)'); - } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "template" TYPE character varying(280)'); + } }