← Back to team overview

dhis2-devs team mailing list archive

Duplicate PERIOD records - WHY no startdate+enddate constraint on PERIOD table?

 

Hi

I have over the last 2-3 weeks had multiple cases with duplicated PERIOD
records in DHIS2 instances. In the latest case, it looks like capturing of
daily data in some cases created duplicated period records - two records
with identical startdate+enddate+periodtype, and sequential periodid. With
most duplicate pairs, only the first periodid had a record in the datavalue
table.

I will try to track down the root cause of this duplicate generation, BUT
what I don't understand is the lack of a periodtypeid+startdate+enddate
constraint on the period table.

Any periodtypeid+startdate+enddate combination would in reality be unique?

I see there's an integrity check for it, but a constraint on the table is
better, I would think.

Besides - where can I view the code/sql used for those integrity checks?

Regards
calle

*******************************************

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19274

Email: calle.hedberg@xxxxxxxxx

Skype: calle_hedberg

*******************************************

Follow ups