-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from plezanje-net/fix/crag-entity-activity-by…
…-month Make activityByMonth field of crag entity non nullable.
- Loading branch information
Showing
3 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class activityByMonthNonNullable1696588233248 | ||
implements MigrationInterface | ||
{ | ||
name = 'activityByMonthNonNullable1696588233248'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "crag" ALTER COLUMN "activity_by_month" SET NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "crag" ALTER COLUMN "activity_by_month" SET DEFAULT '{0,0,0,0,0,0,0,0,0,0,0,0}'`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "crag" ALTER COLUMN "activity_by_month" DROP DEFAULT`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "crag" ALTER COLUMN "activity_by_month" DROP NOT NULL`, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters