dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21619
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10275: Report table upgrade
------------------------------------------------------------
revno: 10275
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-03-17 15:04:28 +0100
message:
Report table upgrade
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
--
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-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 2013-03-14 15:05:25 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-03-17 14:04:28 +0000
@@ -717,23 +717,38 @@
boolean doPeriods = rs.getBoolean( "doperiods" );
boolean doUnits = rs.getBoolean( "dounits" );
- int sortOrder = 0;
+ int columnSortOrder = 0;
+ int rowSortOrder = 0;
if ( doIndicators )
{
- executeSql( "insert into reporttable_columns (reporttableid, dimension, sort_order) values (" + id + ",'dx'," + sortOrder + ");" );
- sortOrder++;
+ executeSql( "insert into reporttable_columns (reporttableid, dimension, sort_order) values (" + id + ",'dx'," + columnSortOrder + ");" );
+ columnSortOrder++;
+ }
+ else
+ {
+ executeSql( "insert into reporttable_rows (reporttableid, dimension, sort_order) values (" + id + ",'dx'," + rowSortOrder + ");" );
+ columnSortOrder++;
}
if ( doPeriods )
{
- executeSql( "insert into reporttable_columns (reporttableid, dimension, sort_order) values (" + id + ",'pe'," + sortOrder + ");" );
- sortOrder++;
+ executeSql( "insert into reporttable_columns (reporttableid, dimension, sort_order) values (" + id + ",'pe'," + columnSortOrder + ");" );
+ columnSortOrder++;
+ }
+ else
+ {
+ executeSql( "insert into reporttable_rows (reporttableid, dimension, sort_order) values (" + id + ",'pe'," + rowSortOrder + ");" );
+ columnSortOrder++;
}
if ( doUnits )
{
- executeSql( "insert into reporttable_columns (reporttableid, dimension, sort_order) values (" + id + ",'ou'," + sortOrder + ");" );
+ executeSql( "insert into reporttable_columns (reporttableid, dimension, sort_order) values (" + id + ",'ou'," + columnSortOrder + ");" );
+ }
+ else
+ {
+ executeSql( "insert into reporttable_rows (reporttableid, dimension, sort_order) values (" + id + ",'ou'," + rowSortOrder + ");" );
}
}