Skip to content

Commit

Permalink
Merge pull request #1349 from bcgov/daniel/fix-3
Browse files Browse the repository at this point in the history
Migrate existing Applications
  • Loading branch information
dhaselhan authored Jan 29, 2024
2 parents 1f89435 + 8c0fde1 commit aa302ae
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,41 @@ export class RemoveDupeGovs1706056918403 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
//City of Port Alberni
await queryRunner.query(`
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."application" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
UPDATE "alcs"."covenant" SET "local_government_uuid" = '1b9887fd-617d-4aef-891c-41dd2ad50d4b' WHERE "local_government_uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'b8a622d7-66da-4598-9687-2e8727fb2561';
`);

//District of Barriere
await queryRunner.query(`
UPDATE "alcs"."application" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
UPDATE "alcs"."covenant" SET "local_government_uuid" = 'a7e16ffa-a218-4f8c-9695-9642a9987e3b' WHERE "local_government_uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'd3f74ba5-0dc3-43ea-a7e2-004882d65c33';
`);

//District of Fort St. James
await queryRunner.query(`
UPDATE "alcs"."application" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
UPDATE "alcs"."covenant" SET "local_government_uuid" = 'b89df1ef-9b1d-494e-8387-b1ba6abaf637' WHERE "local_government_uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
DELETE FROM "alcs"."local_government" WHERE "uuid" = 'e0684ddf-fa61-47c2-87b3-1c72bed5c365';
`);

//District of Hudson’s Hope
await queryRunner.query(`
UPDATE "alcs"."application" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
UPDATE "alcs"."notice_of_intent" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
UPDATE "alcs"."planning_review" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
UPDATE "alcs"."covenant" SET "local_government_uuid" = 'df19457c-4511-4104-bc85-9675412a6359' WHERE "local_government_uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
DELETE FROM "alcs"."local_government" WHERE "uuid" = '79c3e16e-fdb9-4bb0-a427-f044a5d4bb95';
`);

Expand Down

0 comments on commit aa302ae

Please sign in to comment.