fix(server): マイグレーションad1676438468213が通らないのを修正 (#9963)

* fix(server): マイグレーションad1676438468213が通らないのを修正
Fix #9962

* fix
This commit is contained in:
tamaina 2023-02-16 22:08:45 +09:00 committed by GitHub
parent 839a626716
commit 4db787c4ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -1,7 +1,7 @@
export class ad1676438468213 { export class ad1676438468213 {
name = 'ad1676438468213'; name = 'ad1676438468213';
async up(queryRunner) { 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) { async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "role" DROP COLUMN "startsAt"`); await queryRunner.query(`ALTER TABLE "role" DROP COLUMN "startsAt"`);

View File

@ -21,6 +21,7 @@ export class Ad {
@Index() @Index()
@Column('timestamp with time zone', { @Column('timestamp with time zone', {
comment: 'The expired date of the Ad.', comment: 'The expired date of the Ad.',
default: () => 'now()',
}) })
public startsAt: Date; public startsAt: Date;