Skip to content

Commit 06c0710

Browse files
authored
Merge pull request #2091 from bcgov/backport/2025-01-28
Backport: 2025-01-25
2 parents a86055d + 39b1c05 commit 06c0710

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class UpdateLocalGovernmentFor102323Application68165Noi1738010434100 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
// Update Application entity
6+
await queryRunner.query(`
7+
UPDATE "alcs"."application"
8+
SET "local_government_uuid" = (
9+
SELECT "uuid"
10+
FROM "alcs"."local_government"
11+
WHERE "bceid_business_guid" = '04996403089F4A3C8B4ADC3A73DFF0B7'
12+
)
13+
WHERE "file_number" = '102323'
14+
AND "local_government_uuid" = (
15+
SELECT "uuid"
16+
FROM "alcs"."local_government"
17+
WHERE "bceid_business_guid" = '95C27BA79CE148B78D23F19AB075F705'
18+
);
19+
`);
20+
21+
// Update NoticeOfIntent entity
22+
await queryRunner.query(`
23+
UPDATE "alcs"."notice_of_intent"
24+
SET "local_government_uuid" = (
25+
SELECT "uuid"
26+
FROM "alcs"."local_government"
27+
WHERE "bceid_business_guid" = '04996403089F4A3C8B4ADC3A73DFF0B7'
28+
)
29+
WHERE "file_number" = '68165'
30+
AND "local_government_uuid" = (
31+
SELECT "uuid"
32+
FROM "alcs"."local_government"
33+
WHERE "bceid_business_guid" = '95C27BA79CE148B78D23F19AB075F705'
34+
);
35+
`);
36+
}
37+
38+
public async down(queryRunner: QueryRunner): Promise<void> {
39+
// Revert Application entity
40+
await queryRunner.query(`
41+
UPDATE "alcs"."application"
42+
SET "local_government_uuid" = (
43+
SELECT "uuid"
44+
FROM "alcs"."local_government"
45+
WHERE "bceid_business_guid" = '95C27BA79CE148B78D23F19AB075F705'
46+
)
47+
WHERE "file_number" = '102323'
48+
AND "local_government_uuid" = (
49+
SELECT "uuid"
50+
FROM "alcs"."local_government"
51+
WHERE "bceid_business_guid" = '04996403089F4A3C8B4ADC3A73DFF0B7'
52+
);
53+
`);
54+
55+
// Revert NoticeOfIntent entity
56+
await queryRunner.query(`
57+
UPDATE "alcs"."notice_of_intent"
58+
SET "local_government_uuid" = (
59+
SELECT "uuid"
60+
FROM "alcs"."local_government"
61+
WHERE "bceid_business_guid" = '95C27BA79CE148B78D23F19AB075F705'
62+
)
63+
WHERE "file_number" = '68165'
64+
AND "local_government_uuid" = (
65+
SELECT "uuid"
66+
FROM "alcs"."local_government"
67+
WHERE "bceid_business_guid" = '04996403089F4A3C8B4ADC3A73DFF0B7'
68+
);
69+
`);
70+
}
71+
}

0 commit comments

Comments
 (0)