From 4db787c4ee540dbb80c74f4563be3f6a727deed1 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 16 Feb 2023 22:08:45 +0900 Subject: [PATCH] =?UTF-8?q?fix(server):=20=E3=83=9E=E3=82=A4=E3=82=B0?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3ad1676438468213?= =?UTF-8?q?=E3=81=8C=E9=80=9A=E3=82=89=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#9963)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(server): マイグレーションad1676438468213が通らないのを修正 Fix #9962 * fix --- packages/backend/migration/1676438468213-ad3.js | 2 +- packages/backend/src/models/entities/Ad.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/migration/1676438468213-ad3.js b/packages/backend/migration/1676438468213-ad3.js index c55f6ae361..bf1f384adc 100644 --- a/packages/backend/migration/1676438468213-ad3.js +++ b/packages/backend/migration/1676438468213-ad3.js @@ -1,7 +1,7 @@ export class ad1676438468213 { name = 'ad1676438468213'; async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "ad" ADD "startsAt" TIMESTAMP WITH TIME ZONE NOT NULL`); + await queryRunner.query(`ALTER TABLE "ad" ADD "startsAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()`); } async down(queryRunner) { await queryRunner.query(`ALTER TABLE "role" DROP COLUMN "startsAt"`); diff --git a/packages/backend/src/models/entities/Ad.ts b/packages/backend/src/models/entities/Ad.ts index 450336a016..56baf863ca 100644 --- a/packages/backend/src/models/entities/Ad.ts +++ b/packages/backend/src/models/entities/Ad.ts @@ -21,6 +21,7 @@ export class Ad { @Index() @Column('timestamp with time zone', { comment: 'The expired date of the Ad.', + default: () => 'now()', }) public startsAt: Date;