touchRelations

When tasks are added or updated, they may refer to related tasks by UID (Relation.RELATED_UID). However, those related tasks may not be available (for instance, because they have not been synchronized yet), so that the tasks provider can't establish the actual relation (= set Relation.TASK_ID) in the database.

As soon as such a related task is added, OpenTasks updates the Relation.RELATED_ID, but it does not update Tasks.PARENT_ID of the parent task: https://github.com/dmfs/opentasks/issues/877

This method shall be called after all tasks have been synchronized. It touches

  • all Relation rows

  • with Relation.RELATED_ID (→ related task is already synchronized)

  • of tasks without Tasks.PARENT_ID (→ only touch relevant rows)

so that missing Tasks.PARENT_ID fields are updated.

Return

number of touched Relation rows