dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #16196
Re: [Dhis2-devs] Delete Validation Rules
Hi
Agree with Morten that it's a bug - it should be obvious that if you delete
a validation rule, any old validation rule results are no longer of
interest (with the rule deleted, you would not even know which rule any
remaining results were referring too).
So the solution here is that when you delete a validation rule, the system
should automatically first delete any dependent records in the following
tables, which have validationruleid as a foreign key:
"validationnotificationtemplatevalidationrules"
"validationresult"
"validationruleattributevalues"
"validationrulegroupmembers"
"validationruleorganisationunitlevels"
"validationrulesynchstatus"
"validationruletranslations"
"validationruleuseraccesses"
"validationruleusergroupaccesses"
Regards
Calle
On Wed, 8 Aug 2018 at 07:03, Morten Olav Hansen <morten@xxxxxxxxx> wrote:
> Hi Em
>
> I'm not sure if there is any UI for deleting validation results, but you
> can do it yourself in the database.
>
> The validationresults are located in the table "validationresult", and it
> has a column called "validationruleid" which links to your validation rules.
>
> So you need to find that validation rule in the "validationrule" table,
> and use that "validationruleid" to delete the correct rows from the
> "validationresult" table.
>
> "DELETE FROM validationresult WHERE validationruleid=??"
>
> This does sound like a bug though, so please file one in JIRA
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> Team Integration Lead
> University of Oslo
> http://www.dhis2.org
>
> On Tue, Aug 7, 2018 at 5:07 PM, Em Le Hong <em.hispvietnam@xxxxxxxxx>
> wrote:
>
>> Dear all,
>>
>> DHIS 2.29
>>
>> I try to delete a validation rule on my database but the system response
>> a message:
>> Could not delete due to association with another object: ValidationResult
>>
>> This mean we need to delete Validation Result before delete Validation
>> Rule
>>
>> Does anyone know how to delete Validation Result, if you don't mind
>> please share.
>>
>> Thanks,
>> --
>> *Em Le Hong*
>> DHIS2 Implementation| *HISP Vietnam *
>> em.hispvietnam@xxxxxxxxx | *Skype:* em.hispvietnam@xxxxxxxxx
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
--
*******************************************
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-19119
Email: calle.hedberg@xxxxxxxxx
Skype: calle_hedberg
*******************************************
Follow ups
References