Skip to content

Commit

Permalink
COH-60: Fix Liquibase Validation errors with Platform 2.7.0 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
wikumChamith authored Dec 19, 2024
1 parent 02ce6e4 commit 1162372
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
7 changes: 7 additions & 0 deletions api/src/main/resources/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<changeSet id="cohorttype1065" author="sharon">
<validCheckSum>8:f587179e90716bcda0e047348f2dc7b1</validCheckSum>
<validCheckSum>9:0eb2a437c8009f1b33c752ffcf930e08</validCheckSum>
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="cohort_type"/>
Expand Down Expand Up @@ -59,6 +60,7 @@
<changeSet id="cohortattritype1065" author="sharon">
<validCheckSum>3:438b0d7c1f87e1930fc8514e764a006c</validCheckSum>
<validCheckSum>8:7e8d21d7716deb36429dafaa23d3d685</validCheckSum>
<validCheckSum>9:da802d9db20744dd90e1a9eba5a8036d</validCheckSum>
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="cohort_attribute_type"/>
Expand Down Expand Up @@ -139,6 +141,7 @@
</changeSet>
<changeSet id="cohortmodul1065_is_group_cohort" author="sharon">
<validCheckSum>8:5d9f35d099b2a016695f3b49358446f1</validCheckSum>
<validCheckSum>9:0e37aa986011ef9af9bae45b756755c6</validCheckSum>
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cohort" columnName="is_group_cohort"/>
Expand All @@ -165,6 +168,7 @@
<changeSet id="cohortattribute1065" author="sharon">
<validCheckSum>3:17c3a2138b042e7572bbcdb959ba225c</validCheckSum>
<validCheckSum>8:a495f2c0c4e90e7c96e4f387cd4bc284</validCheckSum>
<validCheckSum>9:d63a12c5ed72f16fc8e72c619b0c2c16</validCheckSum>
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="cohort_attribute"/>
Expand Down Expand Up @@ -237,6 +241,7 @@

<changeSet id="add_cohort_member_attribute_type_20210609" author="corneliouzbett">
<validCheckSum>8:e1616c9385aaddae911e3659cc30b8e8</validCheckSum>
<validCheckSum>9:2e13b280dd9b7e419174b26ab6017af2</validCheckSum>
<preConditions onFail="MARK_RAN" onError="WARN">
<not>
<tableExists tableName="cohort_member_attribute_type"/>
Expand Down Expand Up @@ -284,6 +289,7 @@
</changeSet>
<changeSet id="add_cohort_member_attribute_20210607" author="corneliouzbett">
<validCheckSum>8:61e50f3257e9a6afabbfd16ddb660e8b</validCheckSum>
<validCheckSum>9:1562f34ca548184e3691f30e38be8783</validCheckSum>
<preConditions onFail="MARK_RAN" onError="WARN">
<not>
<tableExists tableName="cohort_member_attribute"/>
Expand Down Expand Up @@ -332,6 +338,7 @@

<changeSet id="location_id_to_int" author="ibacher">
<validCheckSum>8:5f7112d12f32e484d14ed88cf5da012f</validCheckSum>
<validCheckSum>9:67ff342ddfaddbb66dcb087f1a76c5e0</validCheckSum>
<preConditions>
<columnExists tableName="cohort" columnName="location_id"/>
</preConditions>
Expand Down
26 changes: 25 additions & 1 deletion api/src/main/resources/liquibase/3.x-liquibase-changeSet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,31 @@
<comment>
Migrate data from cohort leader table into cohort member attributes
</comment>
<sqlFile path="sql/copy-over-cohort-leaders.sql"/>
<sql>
## Migrate data from cohort_leader table to cohort_member_attribute
## Get Cohort Leader cohortMemberAttributeTypeID
set @cohort_member_attribute_type_id = (select cohort_member_attribute_type_id
from cohort_member_attribute_type
where uuid = 'fac24350-c855-4c32-bdcf-36c4c439f538');

## Copy data
insert into cohort_member_attribute (cohort_member_id, value_reference, cohort_member_attribute_type_id, date_created,
creator, changed_by, date_changed, voided_by, date_voided, void_reason, uuid)
select cm.cohort_member_id,
cl.person_id,
@cohort_member_attribute_type_id,
cl.date_created,
cl.creator,
cl.changed_by,
cl.date_changed,
cl.voided_by,
cl.date_voided,
cl.void_reason,
cl.uuid
from cohort_leader cl
left join cohort_member cm on cm.cohort_id = cl.cohort_id

</sql>
</changeSet>

<changeSet id="add_column_definition_handler_20211004" author="corneliouzbett">
Expand Down
22 changes: 0 additions & 22 deletions api/src/main/resources/sql/copy-over-cohort-leaders.sql

This file was deleted.

0 comments on commit 1162372

Please sign in to comment.