← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] Migrated from v2.15 to v2.22 - Data Approval provokes an error

 

Hi Ryan,

Sorry about the delay in responding.

The error you see makes me wonder if the dataapproval table in your MySQL
database was somehow not correctly updated when you upgraded to 2.22.
Before version 2.22, the dataapproval table had a column datasetid, but
starting with 2.22 this column should be absent, and there should be a
workflowid column instead. The columns in the 2.22 dataapproval table
should be equivalent to the following (taken from Postgresql):

CREATE TABLE dataapproval
(
  dataapprovalid integer NOT NULL,
  dataapprovallevelid integer NOT NULL,
  periodid integer NOT NULL,
  organisationunitid integer NOT NULL,
  accepted boolean NOT NULL,
  created timestamp without time zone NOT NULL,
  creator integer NOT NULL,
  attributeoptioncomboid integer NOT NULL,
  workflowid integer NOT NULL,
  CONSTRAINT dataapproval_pkey PRIMARY KEY (dataapprovalid),
  CONSTRAINT fk_dataapproval_attributeoptioncomboid FOREIGN KEY
(attributeoptioncomboid)
      REFERENCES categoryoptioncombo (categoryoptioncomboid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_dataapproval_creator FOREIGN KEY (creator)
      REFERENCES userinfo (userinfoid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_dataapproval_dataapprovallevel FOREIGN KEY
(dataapprovallevelid)
      REFERENCES dataapprovallevel (dataapprovallevelid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_dataapproval_organisationunitid FOREIGN KEY
(organisationunitid)
      REFERENCES organisationunit (organisationunitid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_dataapproval_periodid FOREIGN KEY (periodid)
      REFERENCES period (periodid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_dataapproval_workflowid FOREIGN KEY (workflowid)
      REFERENCES dataapprovalworkflow (workflowid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT dataapproval_unique_key UNIQUE (dataapprovallevelid,
workflowid, periodid, organisationunitid, attributeoptioncomboid)
)
WITH (
  OIDS=FALSE
);

Can you examine the dataapproval table and let me know what it looks like?
(Maybe find a way to extract a "CREATE TABLE" from your MySQL database,
like the above.)

Cheers,
Jim


On Mon, Apr 4, 2016 at 12:32 PM, WILLIAMS, Ryan O'Neil <williamsryan@xxxxxxx
> wrote:

> Dear all,
>
>
>
> I just migrated from v2.15 to v2.22 on a MySQL database.
>
>
>
> I created a workflow and assigned it to all datasets, but I am still
> experiencing the data approval errors/issues.
>
>
>
> Previously approved datasets now show up as “Ready for approval”
>
> When trying to approve a dataset, using “Reports”, “Data Approval”, I get
> the following error in the log
>
> *                Field 'datasetid' doesn't have a default value
> (SqlExceptionHelper.java [http-bio-8092-exec-23])*
>
>
>
> Seems that some default entry is missing, any ideas what?
>
> Thanks in advance for any help.
>
>
>
> *Ryan Williams*
>
> *World Health Organization *
>
> *Global Malaria Programme*
>
> 20 Avenue Appia
>
> 1211 Geneva 27
>
> tel: +41 22 791 4207
>
> fax: +41 22 791 4824
>
> williamsryan@xxxxxxx
>
> www.who.int/malaria
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jim Grace
Core developer, DHIS 2
HISP US Inc.
http://www.dhis2.org <https://www.dhis2.org/>

References