summaryrefslogtreecommitdiff
path: root/packages/backend
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2023-02-16 22:08:45 +0900
committerGitHub <noreply@github.com>2023-02-16 22:08:45 +0900
commit4db787c4ee540dbb80c74f4563be3f6a727deed1 (patch)
tree75c09cef50076e85d1ad1d050961e71aa5e0a3e6 /packages/backend
parentfix(server): dropGroupマイグレーションが通るように (#9961) (diff)
downloadsharkey-4db787c4ee540dbb80c74f4563be3f6a727deed1.tar.gz
sharkey-4db787c4ee540dbb80c74f4563be3f6a727deed1.tar.bz2
sharkey-4db787c4ee540dbb80c74f4563be3f6a727deed1.zip
fix(server): マイグレーションad1676438468213が通らないのを修正 (#9963)
* fix(server): マイグレーションad1676438468213が通らないのを修正 Fix #9962 * fix
Diffstat (limited to 'packages/backend')
-rw-r--r--packages/backend/migration/1676438468213-ad3.js2
-rw-r--r--packages/backend/src/models/entities/Ad.ts1
2 files changed, 2 insertions, 1 deletions
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;