Skip to content

Commit

Permalink
Merge pull request #1966 from patryllus/bug/misaligned-case-manager
Browse files Browse the repository at this point in the history
Updated relationship_type case manager - case manager to case manager- case , Migrated all the misaligned cases in relationships
  • Loading branch information
ojwanganto authored Aug 2, 2024
2 parents 1e1d281 + 52ab396 commit 6f7d9de
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void install() {
install(relationshipType("Partner", "Partner", "Someone I had sex with for fun without commitment to a relationship", _RelationshipType.PARTNER));
install(relationshipType("Co-wife", "Co-wife", "Female member spouse in a polygamist household", _RelationshipType.CO_WIFE));
install(relationshipType("SNS", "SNS", "Social Network Strategy", _RelationshipType.SNS));
install(relationshipType("Case manager", "Case manager", "Case manager", _RelationshipType.CASE_MANAGER));
install(relationshipType("Case manager", "Client", "Case manager", _RelationshipType.CASE_MANAGER));
install(relationshipType("Primary caregiver", "Primary caregiver", "Primary caregiver", _RelationshipType.CARE_GIVER));


Expand Down
30 changes: 30 additions & 0 deletions api/src/main/resources/AlignCaseManagerCaseRelationships.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

SET FOREIGN_KEY_CHECKS=0;

UPDATE relationship_type SET b_is_to_a = 'Client' WHERE uuid = '9065e3c6-b2f5-4f99-9cbf-f67fd9f82ec5';

UPDATE relationship r
INNER JOIN relationship_type t ON r.relationship = t.relationship_type_id
SET r.person_a = r.person_b , r.person_b = r.person_a
WHERE t.uuid = '9065e3c6-b2f5-4f99-9cbf-f67fd9f82ec5';

SET FOREIGN_KEY_CHECKS=1;



















9 changes: 8 additions & 1 deletion omod/src/main/resources/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,11 @@
<sqlFile splitStatements="true" path="MigrateAppointmentsFromObs.sql"/>
</changeSet>

</databaseChangeLog>
<changeSet id="${project.parent.artifactId}-20240801-1408" author="pwangoo">
<comment>
Queries for migrating misaligned Case manager - Case relationships
</comment>
<sqlFile splitStatements="true" path="AlignCaseManagerCaseRelationships.sql"/>
</changeSet>

</databaseChangeLog>

0 comments on commit 6f7d9de

Please sign in to comment.