-
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.
fix: make seed mock script work again (#6003)
* fix: make seed mock script work again * fix: revert to abbreviated sequence name
- Loading branch information
1 parent
be6d4ef
commit 62a6df1
Showing
13 changed files
with
41 additions
and
41 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
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
13 changes: 7 additions & 6 deletions
13
services/121-service/src/scripts/sql/mock-intersolve-voucher-attributes.sql
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
WITH fsp_data AS ( | ||
SELECT fa.id | ||
FROM "121-service".financial_service_provider_question fa | ||
LEFT JOIN "121-service".financial_service_provider f ON f.id = fa."fspId" | ||
WHERE "name" = 'whatsappPhoneNumber' AND f.fsp = 'Intersolve-voucher-whatsapp' | ||
SELECT pra.id | ||
FROM "121-service".program_registration_attribute pra | ||
LEFT JOIN "121-service".program p ON p.id = pra."programId" | ||
LEFT JOIN "121-service".program_financial_service_provider_configuration f ON f."programId" = p.id | ||
WHERE pra."name" = 'whatsappPhoneNumber' AND f."financialServiceProviderName" = 'Intersolve-voucher-whatsapp' | ||
) | ||
|
||
UPDATE "121-service".intersolve_voucher iv | ||
SET "whatsappPhoneNumber" = rd."value" | ||
FROM "121-service".imagecode_export_vouchers iev | ||
LEFT JOIN "121-service".registration r ON r.id = iev."registrationId" | ||
LEFT JOIN "121-service".registration_data rd ON r.id = rd."registrationId", fsp_data fd | ||
WHERE iv.id = iev."voucherId" AND rd."fspQuestionId" = fd.id; | ||
LEFT JOIN "121-service".registration_attribute_data rd ON r.id = rd."registrationId", fsp_data fd | ||
WHERE iv.id = iev."voucherId" AND rd."programRegistrationAttributeId" = fd.id; |
8 changes: 4 additions & 4 deletions
8
services/121-service/src/scripts/sql/mock-make-phone-unique.sql
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
update "121-service".registration_data | ||
update "121-service".registration_attribute_data | ||
set "value" = CAST(10000000000 + floor(random() * 90000000000) AS bigint) | ||
WHERE "programQuestionId" IN (SELECT id FROM "121-service".program_question WHERE "name" = 'phoneNumber') OR "fspQuestionId" IN (SELECT id FROM "121-service".financial_service_provider_question WHERE "name" = 'whatsappPhoneNumber'); | ||
WHERE "programRegistrationAttributeId" IN (SELECT id FROM "121-service".program_registration_attribute WHERE "name" = 'phoneNumber' OR "name" = 'whatsappPhoneNumber'); | ||
; | ||
update "121-service".registration r | ||
set "phoneNumber" = rd."value" | ||
from "121-service".registration_data rd | ||
where rd."registrationId" = r."id" and rd."programQuestionId" in (SELECT id FROM "121-service".program_question WHERE "name" = 'phoneNumber') | ||
from "121-service".registration_attribute_data rd | ||
where rd."registrationId" = r."id" and rd."programRegistrationAttributeId" in (SELECT id FROM "121-service".program_registration_attribute WHERE "name" = 'phoneNumber') | ||
; |
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
16 changes: 7 additions & 9 deletions
16
services/121-service/src/scripts/sql/mock-registration-data.sql
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
INSERT | ||
INTO | ||
"121-service"."registration_data" ( | ||
"121-service"."registration_attribute_data" ( | ||
SELECT | ||
id + ( | ||
SELECT | ||
max(id) | ||
FROM | ||
"121-service"."registration_data") AS id, | ||
"121-service"."registration_attribute_data") AS id, | ||
created, | ||
updated, | ||
"registrationId" + ( | ||
SELECT | ||
max("registrationId") | ||
FROM | ||
"121-service"."registration_data") AS "registrationId", | ||
"programQuestionId", | ||
"fspQuestionId", | ||
"programCustomAttributeId", | ||
value, | ||
updated | ||
"121-service"."registration_attribute_data") AS "registrationId", | ||
"programRegistrationAttributeId", | ||
value | ||
FROM | ||
"121-service"."registration_data"); | ||
"121-service"."registration_attribute_data"); |
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