Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | BIGINT | 19 | √ | null |
|
|
|||||
| person_id | BIGINT | 19 | null |
|
|
The id of the person record |
|||||
| patient_id | BIGINT | 19 | null |
|
|
The id of the patient record |
|||||
| linked_date | DATETIME | 19 | current_timestamp() |
|
|
When the link was created |
|||||
| linked_by | BIGINT | 19 | √ | NULL |
|
|
The id of the user that created this record |
||||
| link_method | VARCHAR | 50 | √ | 'manual' |
|
|
How link was created: manual, auto_detected, migrated, import |
||||
| notes | TEXT | 65535 | √ | NULL |
|
|
Optional notes about why/how they were linked |
||||
| active | BOOLEAN | 3 | 1 |
|
|
Whether link is active (allows soft delete) |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| PRIMARY | Primary key | Asc | id |
| idx_ppl_active | Performance | Asc | active |
| idx_ppl_linked_date | Performance | Asc | linked_date |
| idx_ppl_method | Performance | Asc | link_method |
| idx_ppl_patient | Performance | Asc | patient_id |
| idx_ppl_person | Performance | Asc | person_id |
| unique_active_link | Must be unique | Asc/Asc/Asc | person_id + patient_id + active |