← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4909: Removing outdated period types in TableAlteror startup routine

 

------------------------------------------------------------
revno: 4909
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-10-12 14:42:13 +0200
message:
  Removing outdated period types in TableAlteror startup routine
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.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	2011-10-03 14:50:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-10-12 12:42:13 +0000
@@ -106,10 +106,10 @@
         executeSql( "ALTER TABLE indicator DROP COLUMN extendeddataelementid" );
         executeSql( "ALTER TABLE indicator DROP COLUMN numeratoraggregationtype" );
         executeSql( "ALTER TABLE indicator DROP COLUMN denominatoraggregationtype" );
-
+        
         // remove relative period type
-        executeSql( "DELETE FROM period WHERE periodtypeid=(select periodtypeid from periodtype where name='Relative')" );
-        executeSql( "DELETE FROM periodtype WHERE name='Relative'" );
+        executeSql( "DELETE FROM period WHERE periodtypeid=(select periodtypeid from periodtype where name in ( 'Survey', 'OnChange', 'Relative' ))" );
+        executeSql( "DELETE FROM periodtype WHERE name in ( 'Survey', 'OnChange', 'Relative' )" );
 
         // mapping
         executeSql( "DROP TABLE maporganisationunitrelation" );

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java	2011-10-12 12:42:13 +0000
@@ -56,9 +56,9 @@
         {
             startupRoutineExecutor.execute();
         }
-        catch ( Exception e )
+        catch ( Exception ex )
         {
-            throw new RuntimeException( "Failed to run startup routines", e );
+            throw new RuntimeException( "Failed to run startup routines: " + ex.getMessage(), ex );
         }
     }