|
| 1 | +```mermaid |
| 2 | +--- |
| 3 | +Django ER Diagram |
| 4 | +--- |
| 5 | +erDiagram |
| 6 | +LogEntry { |
| 7 | + AutoField id |
| 8 | + DateTimeField action_time |
| 9 | + ForeignKey user |
| 10 | + ForeignKey content_type |
| 11 | + TextField object_id |
| 12 | + CharField object_repr |
| 13 | + PositiveSmallIntegerField action_flag |
| 14 | + TextField change_message |
| 15 | +} |
| 16 | +Permission { |
| 17 | + AutoField id |
| 18 | + CharField name |
| 19 | + ForeignKey content_type |
| 20 | + CharField codename |
| 21 | +} |
| 22 | +Group { |
| 23 | + AutoField id |
| 24 | + CharField name |
| 25 | + ManyToManyField permissions |
| 26 | +} |
| 27 | +User { |
| 28 | + AutoField id |
| 29 | + CharField password |
| 30 | + DateTimeField last_login |
| 31 | + BooleanField is_superuser |
| 32 | + CharField username |
| 33 | + CharField first_name |
| 34 | + CharField last_name |
| 35 | + CharField email |
| 36 | + BooleanField is_staff |
| 37 | + BooleanField is_active |
| 38 | + DateTimeField date_joined |
| 39 | + ManyToManyField groups |
| 40 | + ManyToManyField user_permissions |
| 41 | +} |
| 42 | +ContentType { |
| 43 | + AutoField id |
| 44 | + CharField app_label |
| 45 | + CharField model |
| 46 | +} |
| 47 | +Session { |
| 48 | + CharField session_key |
| 49 | + TextField session_data |
| 50 | + DateTimeField expire_date |
| 51 | +} |
| 52 | +AuditLog { |
| 53 | + UUIDField id |
| 54 | + DateTimeField created_at |
| 55 | + ForeignKey content_type |
| 56 | + UUIDField object_id |
| 57 | + CharField operation |
| 58 | + JSONField snapshot |
| 59 | + ForeignKey actor |
| 60 | + CharField system_update_id |
| 61 | +} |
| 62 | +Provider { |
| 63 | + UUIDField id |
| 64 | + DateTimeField created_at |
| 65 | + DateTimeField updated_at |
| 66 | + TextField name |
| 67 | +} |
| 68 | +Setting { |
| 69 | + UUIDField id |
| 70 | + DateTimeField created_at |
| 71 | + DateTimeField updated_at |
| 72 | + TextField name |
| 73 | + ForeignKey provider |
| 74 | +} |
| 75 | +Clinic { |
| 76 | + UUIDField id |
| 77 | + DateTimeField created_at |
| 78 | + DateTimeField updated_at |
| 79 | + ForeignKey setting |
| 80 | + DateTimeField starts_at |
| 81 | + DateTimeField ends_at |
| 82 | + CharField type |
| 83 | + CharField risk_type |
| 84 | +} |
| 85 | +ClinicSlot { |
| 86 | + UUIDField id |
| 87 | + DateTimeField created_at |
| 88 | + DateTimeField updated_at |
| 89 | + ForeignKey clinic |
| 90 | + DateTimeField starts_at |
| 91 | + IntegerField duration_in_minutes |
| 92 | +} |
| 93 | +ClinicStatus { |
| 94 | + UUIDField id |
| 95 | + DateTimeField created_at |
| 96 | + CharField state |
| 97 | + ForeignKey clinic |
| 98 | +} |
| 99 | +Participant { |
| 100 | + UUIDField id |
| 101 | + DateTimeField created_at |
| 102 | + DateTimeField updated_at |
| 103 | + TextField first_name |
| 104 | + TextField last_name |
| 105 | + TextField gender |
| 106 | + TextField nhs_number |
| 107 | + TextField phone |
| 108 | + CharField email |
| 109 | + DateField date_of_birth |
| 110 | + CharField ethnic_group |
| 111 | + TextField risk_level |
| 112 | + JSONField extra_needs |
| 113 | +} |
| 114 | +ParticipantAddress { |
| 115 | + UUIDField id |
| 116 | + OneToOneField participant |
| 117 | + ArrayField lines |
| 118 | + CharField postcode |
| 119 | +} |
| 120 | +ScreeningEpisode { |
| 121 | + UUIDField id |
| 122 | + DateTimeField created_at |
| 123 | + DateTimeField updated_at |
| 124 | + ForeignKey participant |
| 125 | +} |
| 126 | +Appointment { |
| 127 | + UUIDField id |
| 128 | + DateTimeField created_at |
| 129 | + DateTimeField updated_at |
| 130 | + ForeignKey screening_episode |
| 131 | + ForeignKey clinic_slot |
| 132 | + BooleanField reinvite |
| 133 | + JSONField stopped_reasons |
| 134 | +} |
| 135 | +AppointmentStatus { |
| 136 | + CharField state |
| 137 | + UUIDField id |
| 138 | + DateTimeField created_at |
| 139 | + ForeignKey appointment |
| 140 | +} |
| 141 | +LogEntry }|--|| User : user |
| 142 | +LogEntry }|--|| ContentType : content_type |
| 143 | +Permission }|--|| ContentType : content_type |
| 144 | +Group }|--|{ Permission : permissions |
| 145 | +User }|--|{ Group : groups |
| 146 | +User }|--|{ Permission : user_permissions |
| 147 | +AuditLog }|--|| ContentType : content_type |
| 148 | +AuditLog }|--|| User : actor |
| 149 | +Setting }|--|| Provider : provider |
| 150 | +Clinic }|--|| Setting : setting |
| 151 | +ClinicSlot }|--|| Clinic : clinic |
| 152 | +ClinicStatus }|--|| Clinic : clinic |
| 153 | +ParticipantAddress ||--|| Participant : participant |
| 154 | +ScreeningEpisode }|--|| Participant : participant |
| 155 | +Appointment }|--|| ScreeningEpisode : screening_episode |
| 156 | +Appointment }|--|| ClinicSlot : clinic_slot |
| 157 | +AppointmentStatus }|--|| Appointment : appointment |
| 158 | +``` |
0 commit comments