polivagit / Medlink

Main repoistory for Medlink project (2023).
0 stars 0 forks source link

Medlink - MySQL DB development & integration #4

Open polivagit opened 1 year ago

polivagit commented 1 year ago

MySQL Medlink Database

All our Medlink applications will connect to a MySQL database where all project data is gathered and managed. For this project, we will be using MySQL Workbench for designing and managing the database.

Database diagram.

Reference model:

medlink_model

Generate DB scripts from previous diagram.

Tables: Guidelines & definitions.

1. Person.

2.1. [Person] Patient.

2.2. [Person] Doctor.

3. Treatment.

4. Medicine.

5. _[Treatment - Medicine, (N:M)] TreatmentMedicine.

6. _Unit_OfMeasure.

7. _MedicineCategory.

8. _MedicalSpecialty.

Observations.

⚠ For DATE CONSTRAINTS, instead of CHECK we will be using TRIGGERS. With MySQL 8.0.13+ versions, you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. ⚠

Fields affected by this issue:

See documentation for more info about this issue:
https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html https://dev.mysql.com/doc/refman/8.0/en/create-table-check-constraints.html