-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ApiEventKinds): Refactors Feature Import realted ApiEventKin…
…ds to be include "project." prefix
- Loading branch information
1 parent
44e71bc
commit fe9087c
Showing
7 changed files
with
75 additions
and
23 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
api/apps/api/src/migrations/api/1713199859318-RefactorFeatureImportApiEventKinds.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,37 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class RefactorFeatureImportApiEventKinds1713199859318 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
INSERT INTO api_event_kinds VALUES | ||
('project.features.csv.import.submitted/v1/alpha'), | ||
('project.features.csv.import.finished/v1/alpha'), | ||
('project.features.csv.import.failed/v1/alpha'), | ||
('project.features.shapefile.import.submitted/v1/alpha'), | ||
('project.features.shapefile.import.finished/v1/alpha'), | ||
('project.features.shapefile.import.failed/v1/alpha'); | ||
UPDATE api_events set kind = 'project.' || kind where kind like 'features.%'; | ||
DELETE FROM api_event_kinds WHERE id like 'features.%'; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
INSERT INTO api_event_kinds VALUES | ||
('features.csv.import.submitted/v1/alpha'), | ||
('features.csv.import.finished/v1/alpha'), | ||
('features.csv.import.failed/v1/alpha'), | ||
('features.shapefile.import.submitted/v1/alpha'), | ||
('features.shapefile.import.finished/v1/alpha'), | ||
('features.shapefile.import.failed/v1/alpha'); | ||
UPDATE api_events set kind = REPLACE(id, 'project.features.', 'features.' ) where kind like 'project.features.%'; | ||
DELETE FROM api_event_kinds WHERE id like 'project.features.%'; | ||
`); | ||
} | ||
} |
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
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