| | 1 | = Update Detection during Imports = |
| | 2 | |
| | 3 | Data imports can do both - create new records in the database and update existing ones. |
| | 4 | |
| | 5 | If Sahana Eden can identify an import item with an existing record, this record will be updated rather than a new record being created. |
| | 6 | |
| | 7 | In order to identify the import item, Eden uses a cascade of rules: |
| | 8 | |
| | 9 | 1. Identification by UUID |
| | 10 | 2. Identification by other unique keys |
| | 11 | 3. Identification by table-specific rules |
| | 12 | |
| | 13 | == Identification by UUID == |
| | 14 | |
| | 15 | Every record in the Sahana Eden database has a UUID field (universally unique identifier), see [wiki: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. |
| | 16 | |
| | 17 | == Identification by Other Unique Keys == |
| | 18 | |
| | 19 | 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. |
| | 20 | |
| | 21 | == Table-Specific Identification Rules == |
| | 22 | |
| | 23 | 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. |
| | 24 | |
| | 25 | === Person Records === |
| | 26 | |
| | 27 | - ''tbw'' |