This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #105 from bcgov/IOD-226
added default values to software columns
- Loading branch information
Showing
2 changed files
with
43 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class SoftwareRefactor1657819940609 implements MigrationInterface { | ||
name = 'SoftwareRefactor1657819940609'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "publisher" DROP NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "publisher" SET DEFAULT ''`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "administrator" DROP NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "administrator" SET DEFAULT ''`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "administrator" DROP DEFAULT`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "administrator" SET NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "publisher" DROP DEFAULT`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "software_titles" ALTER COLUMN "publisher" SET 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