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;