From: Peter L. <pal...@gm...> - 2011-05-16 23:24:20
|
On the subject of database integrity which I raised in my previous email on the simple timesheet: I notice in task_maint.php this pop-up message: if (confirm('Deleting a task which has been used in the past will make those timesheet ' + 'entries invalid, and may cause errors. This action is not recommended. ' + 'Are you sure you want to delete this task?')) There is a recognition of creating errors by deleting a task. This is all about database integrity, but it's not handled at all well. task_action.php deletes entries from the task_table and the task_assignments table, which leaves all the times table entries with a task number that no longer exists. I guess at the time it was a bit too complex a situation to handle and wasn't cleanly implemented. But it is an illustration of why data integrity is important, and that we should code for it. A database is a different entity to a collection of files. Peter |