Bug #446
closedOrphaned dates in database
Description
If e.g. a Person with relations is deleted, the relations are deleted but the relation dates remain.
I'm trying to avoid to "manualy" delete them because there will be many cases like that and it's just too error prone.
Another aproach would be to write a cleanup function which searches for orphaned entries and call it with every delete.
Update
Deleting dates (from entities), alternative names, and location/gis data already implemented.
Did a check on existing data and dates of property links seem to be the only orphaned ones.
No link dates, aliases or gis entries were orphaned.
SQL to check for orphaned data (doesn't detect dates of property links because they still have a type)
SELECT e.id FROM crm.entity e LEFT JOIN crm.link l1 on e.id = l1.domain_id LEFT JOIN crm.link l2 on e.id = l2.range_id LEFT JOIN crm.link_property lp1 on e.id = lp1.domain_id LEFT JOIN crm.link_property lp2 on e.id = lp2.range_id WHERE l1.domain_id IS NULL AND l2.range_id IS NULL AND lp1.domain_id IS NULL AND lp2.range_id IS NULL
Updated by Alexander Watzinger over 9 years ago
- Project changed from 19 to OpenAtlas
- Target version deleted (
37) - Category deleted (
37)
Updated by Alexander Watzinger over 9 years ago
- Category set to Backend
- Target version set to 0.9.0
Updated by Alexander Watzinger over 9 years ago
- Target version changed from 0.9.0 to 0.10.0
Updated by Alexander Watzinger over 9 years ago
- Target version changed from 0.10.0 to 1.0.0
Updated by Alexander Watzinger about 9 years ago
- Target version changed from 1.0.0 to 1.1.0
moved again (to version > 1) because no test data available
Updated by Alexander Watzinger about 9 years ago
- Target version changed from 1.1.0 to 2.0.0
Updated by Alexander Watzinger about 9 years ago
- Target version changed from 2.0.0 to 1.2.0
Updated by Alexander Watzinger about 9 years ago
- Description updated (diff)
- Status changed from Assigned to In Progress
Updated by Alexander Watzinger about 9 years ago
- Target version changed from 1.2.0 to 76
Updated by Alexander Watzinger almost 9 years ago
- Target version changed from 76 to 86
Updated by Alexander Watzinger almost 8 years ago
- Target version changed from 86 to 2.4.0
Updated by Alexander Watzinger over 7 years ago
- Target version changed from 2.4.0 to 2.3.2
Updated by Alexander Watzinger over 7 years ago
- Status changed from In Progress to Closed
After checking again in 2017 I only found orphaned dates from property_links. The upgrade instruction for 2.3.2. includes SQL statements for removing them and adding a trigger to prevent furhter ones. Closed.