|Version 1 (modified by 11 years ago) ( diff ),|
Update Detection during Imports
Data imports can do both - create new records in the database and update existing ones.
If Sahana Eden can identify an import item with an existing record, this record will be updated rather than a new record being created.
In order to identify the import item, Eden uses a cascade of rules:
- Identification by UUID
- Identification by other unique keys
- Identification by table-specific rules
Identification by UUID
Every record in the Sahana Eden database has a UUID field (universally unique identifier), see UUID. If an import item contains a UUID and it matches an existing database record, this record will be updated rather than creating a new record.
Identification by Other Unique Keys
Some database tables use additional unique keys, e.g. the "name" field in organisations. These keys can be used instead of UUIDs to indicate updates - however: if there is also a UUID present in the import item, then only the UUID will be used to identify the record to update.
Table-Specific Identification Rules
For many database tables, Sahana Eden has additional table-specific rules to identify records in cases where the import item does not contain a UUID and no match can be found by unique keys.