Skip to content

Commit

Permalink
Improve FertiScan DB Architecture (#71)
Browse files Browse the repository at this point in the history
* Issue #70: Schema update

* Issue #70: Update location relationship

* Issue #70: Update user-picture_set relationship

* Issue #70: Update organisation-location

* Issue #70: lint fix
  • Loading branch information
Francois-Werbrouck authored Jul 15, 2024
1 parent 45b0a4f commit 2dedec9
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions doc/fertiScan-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,51 +24,50 @@ erDiagram
picture{
uuid id PK
json picture
uuid picture_set_id FK
uuid parent FK
int nb_object
boolean verified
boolean used_for_digitalization
timestamp upload_date
uuid picture_set_id FK
uuid parent_picture_id FK
}
analysis {
inspection {
uuid id PK
uuid user_id FK
boolean verified
uuid label_info fk
TIMESTAMP upload_date
TIMESTAMP updated_at
uuid fertilizer_id
uuid inspector_id FK
uuid label_info Fk
uuid fertilizer_id FK
uuid sample_id FK
uuid company_id FK
uuid manufacturer_id FK
uuid picture_id
uuid picture_set_id FK
}
fertilizer{
uuid id PK
string name "Unique"
string registration_number
timestamp upload_date
timestamp update_at
uuid latest_analysis FK
uuid respo_id FK
uuid latest_inspection_id FK
uuid owner_id FK
}
responsable{
organization{
uuid id PK
string name
string name "unique"
string website
string phone_number
uuid location_id
uuid main_location_id FK
}
location{
uuid id PK
string address
region_id uuid FK
uuid organization_id FK
uuid region_id FK
}
sample{
uuid id PK
uuid number
Date collection_date
uuid location FK
}
province{
int id PK
Expand Down Expand Up @@ -96,8 +95,8 @@ erDiagram
uuid id PK
text content_fr
text content_en
uuid label_id FK
boolean edited
uuid label_id FK
uuid sub_type_id FK
}
sub_type{
Expand All @@ -116,8 +115,8 @@ erDiagram
metric{
uuid id PK
float value
uuid unit_id FK
boolean edited
uuid unit_id FK
}
unit{
uuid id PK
Expand All @@ -129,17 +128,17 @@ erDiagram
string read_name
float value
string unit
int element_id FK
boolean edited
uuid label_id FK
int element_id FK
}
guaranteed{
uuid id PK
string read_name
float value
string unit
int element_id FK
boolean edited
int element_id FK
uuid label_id FK
}
ingredient{
Expand All @@ -155,18 +154,19 @@ erDiagram
string name_en
string symbol
}
analysis ||--|| sample :has
picture }o--|| picture_set: contains
analysis ||--|| responsable :manage
fertilizer ||--|| responsable: manage
analysis ||--|| users :does
analysis ||--o{ picture :has
analysis ||--|| fertilizer : represent
analysis ||--|| label_information : defines
province ||--|| region: apart
region ||--|| location: defines
responsable ||--|| location: located
sample ||--|| location: taken
inspection ||--|| sample :has
picture_set ||--|{picture : contains
inspection ||--o| organization: manufacturer
inspection ||--o| organization: company
fertilizer ||--|| organization: responsable
location }|--|| organization: host
organization ||--|| location: HQ
location ||--|| region: defines
region ||--|| province: apart
inspection ||--|| fertilizer : about
inspection ||--|| users :inspect
inspection ||--o| picture_set :has
inspection ||--|| label_information : defines
label_information ||--|o metric: weight
label_information ||--|o metric: density
label_information ||--|o metric: volume
Expand All @@ -176,7 +176,7 @@ erDiagram
label_information ||--|{ specification: has
label_information ||--|{ sub_label: has
sub_label }o--|| sub_type: defines
users ||--o{ picture_set: owns
metric ||--|| unit: defines
micronutrient ||--|| element_compound: is
guaranteed ||--|| element_compound: is
Expand Down

0 comments on commit 2dedec9

Please sign in to comment.