← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17292: Change dataapproval.categoryoptioncomboid to .attributeoptioncomboid

 

------------------------------------------------------------
revno: 17292
committer: jimgrace@xxxxxxxxx
branch nick: dhis2
timestamp: Sun 2014-10-26 15:03:48 -0400
message:
  Change dataapproval.categoryoptioncomboid to .attributeoptioncomboid
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataapproval/hibernate/DataApproval.hbm.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java	2014-10-26 07:41:39 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java	2014-10-26 19:03:48 +0000
@@ -238,7 +238,7 @@
             "from dataapproval da " +
             "inner join dataapprovallevel dal on da.dataapprovallevelid = dal.dataapprovallevelid " +
             "where da.periodid = dv.periodid " +
-            "and da.categoryoptioncomboid = dv.attributeoptioncomboid " +
+            "and da.attributeoptioncomboid = dv.attributeoptioncomboid " +
             "and des.datasetid = da.datasetid " +
             "and (";
         

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2014-10-26 07:59:12 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2014-10-26 19:03:48 +0000
@@ -260,7 +260,7 @@
                 "left outer join dataelementcategoryoptionusergroupaccesses couga on couga.categoryoptionid = cocco.categoryoptionid " +
                 "left outer join usergroupaccess uga on uga.usergroupaccessid = couga.usergroupaccessid " +
                 "left outer join usergroupmembers ugm on ugm.usergroupid = uga.usergroupid " +
-                "left outer join dataapproval da on da.categoryoptioncomboid = ccoc.categoryoptioncomboid and da.periodid in (" + sPeriods + ") " +
+                "left outer join dataapproval da on da.attributeoptioncomboid = ccoc.categoryoptioncomboid and da.periodid in (" + sPeriods + ") " +
                 "left outer join dataapprovallevel dal on dal.dataapprovallevelid = da.dataapprovallevelid " +
                 "left outer join _orgunitstructure ousda on ousda.organisationunitid = da.organisationunitid " +
                 "where ccoc.categorycomboid in (" + sDataSetCCs + ") " +

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-10-23 09:39:12 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-10-26 19:03:48 +0000
@@ -743,8 +743,10 @@
         executeSql( "ALTER TABLE dataapproval ALTER COLUMN accepted SET NOT NULL" );
         executeSql( "DELETE FROM dataapproval WHERE categoryoptiongroupid IS NOT NULL" );
         executeSql( "ALTER TABLE dataapproval DROP COLUMN categoryoptiongroupid" );
-        executeSql( "UPDATE dataapproval SET categoryoptioncomboid=" + defaultCategoryComboId + " WHERE categoryoptioncomboid IS NULL" );
-        executeSql( "ALTER TABLE dataapproval ALTER COLUMN categoryoptioncomboid SET NOT NULL" );
+        executeSql( "UPDATE dataapproval SET attributeoptioncomboid=categoryoptioncomboid WHERE categoryoptioncomboid IS NOT NULL" );
+        executeSql( "ALTER TABLE dataapproval DROP COLUMN categoryoptioncomboid" );
+        executeSql( "UPDATE dataapproval SET attributeoptioncomboid=" + defaultCategoryComboId + " WHERE attributeoptioncomboid IS NULL" );
+        executeSql( "ALTER TABLE dataapproval ALTER COLUMN attributeoptioncomboid SET NOT NULL" );
 
         // validation rule group, new column alertbyorgunits
         executeSql( "UPDATE validationrulegroup SET alertbyorgunits=false WHERE alertbyorgunits IS NULL" );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataapproval/hibernate/DataApproval.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataapproval/hibernate/DataApproval.hbm.xml	2014-10-21 19:45:22 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataapproval/hibernate/DataApproval.hbm.xml	2014-10-26 19:03:48 +0000
@@ -15,7 +15,7 @@
     <many-to-one name="dataSet" class="org.hisp.dhis.dataset.DataSet" column="datasetid" not-null="true" foreign-key="fk_dataapproval_datasetid" unique-key="dataapproval_unique_key" />
     <many-to-one name="period" class="org.hisp.dhis.period.Period" column="periodid" not-null="true" foreign-key="fk_dataapproval_periodid" unique-key="dataapproval_unique_key" />
     <many-to-one name="organisationUnit" class="org.hisp.dhis.organisationunit.OrganisationUnit" not-null="true" column="organisationunitid" foreign-key="fk_dataapproval_organisationunitid" unique-key="dataapproval_unique_key" />
-    <many-to-one name="attributeOptionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid" foreign-key="fk_dataapproval_categoryoptioncomboid" unique-key="dataapproval_unique_key" />
+    <many-to-one name="attributeOptionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="attributeoptioncomboid" foreign-key="fk_dataapproval_attributeoptioncomboid" unique-key="dataapproval_unique_key" />
 
     <property name="accepted" type="boolean" />