← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13464: Script

 

------------------------------------------------------------
revno: 13464
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-12-29 17:35:59 +0100
message:
  Script
modified:
  resources/sql/div.sql


--
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 'resources/sql/div.sql'
--- resources/sql/div.sql	2013-12-29 15:55:10 +0000
+++ resources/sql/div.sql	2013-12-29 16:35:59 +0000
@@ -193,6 +193,13 @@
   from organisationunit ou
   where psi.organisationunitid=ou.organisationunitid );
 
+-- (Write) Move startdate and enddate in period to next year
+
+update period set 
+startdate = (startdate + interval '1 year')::date,
+enddate = (enddate + interval '1 year')::date
+where extract(year from startdate) = 2013;
+
 -- (Write) Insert random org unit codes
 
 create function setrandomcode() returns integer AS $$