Dashboard > DHIS-2 > ... > DHIS 2 development > Database update SQL statements
  DHIS-2 Log In | Sign Up   View a printable version of the current page.  
  Database update SQL statements
Added by Lars Helge Ă˜verland, last edited by Knut Staring on Nov 10, 2008  (view change)
Labels: 
(None)

Database update SQL statements

Version 2.0

These two statements will also require the views (needed for openhealth etc.) depending on these tables to be deleted!
drop table aggregateddatavalue;
drop table aggregatedindicatorvalue;

drop table extendeddataelement;
drop table importobject;
drop table importdatavalue;

create index crosstab on datavalue (periodid, sourceid);

  • For Mysql*
    alter table indicator modify column numerator text;
    alter table indicator modify column denominator text;

For Postgresql
alter table indicator alter column numerator type text;_
alter table indicator alter column denominator type text;

After the system has been started at least once:

update datavalue set categoryoptioncomboid=(select categoryoptioncomboid from categorycombos_optioncombos where categorycomboid=(select categorycomboid from categorycombo where name='default'));

Version M9

alter table dataelement drop foreign key fk_expression_expressionid;
alter table dataelement drop column expressionid;
alter table dataelement drop column calculated;

rename table structure to orgunithierarchystructure;
alter table orgunithierarchystructure change idx organisationunitid int(11);
alter table orgunithierarchystructure change elt parentid int(11);

Version M8

alter table dataset drop column type;

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators