-
Notifications
You must be signed in to change notification settings - Fork 15
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 #1454 from rodekruis/refactor.disaster-type-per-layer
Refactor.disaster type per layer
- Loading branch information
Showing
17 changed files
with
309 additions
and
477 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
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
43 changes: 43 additions & 0 deletions
43
services/API-service/migration/1693224120772-RemoveLayerCountryDisasterType.ts
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,43 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class RemoveLayerCountryDisasterType1693224120772 | ||
implements MigrationInterface | ||
{ | ||
name = 'RemoveLayerCountryDisasterType1693224120772'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."indicator-metadata" DROP COLUMN "countryCodes"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."layer-metadata" DROP COLUMN "countryCodes"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."indicator-metadata" DROP COLUMN "aggregateIndicator"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."indicator-metadata" ADD "countryDisasterTypes" json NOT NULL DEFAULT '{}'`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."layer-metadata" ADD "countryDisasterTypes" json NOT NULL DEFAULT '{}'`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."indicator-metadata" DROP COLUMN "countryDisasterTypes"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."layer-metadata" DROP COLUMN "countryDisasterTypes"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."indicator-metadata" ADD "aggregateIndicator" character varying`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."layer-metadata" ADD "countryCodes" character varying`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "IBF-app"."indicator-metadata" ADD "countryCodes" character varying`, | ||
); | ||
} | ||
} |
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
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
18 changes: 5 additions & 13 deletions
18
services/API-service/src/api/metadata/layer-metadata.entity.ts
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
Oops, something went wrong.