Skip to content

Commit

Permalink
chore: 🔨 update db structure
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay committed Feb 20, 2024
1 parent 755388a commit 80ef3bb
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mermaid/mmd/dataset-metadata-er.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ erDiagram
DATASET_CONTRIBUTOR {
string id PK "UUIDv4"
string dataset_id FK "DATASET.id"
string givenName
string familyName "NULLABLE"
string given_name
string family_name "NULLABLE"
string name_type "NULLABLE"
string name_identifier
string name_identifier_scheme
Expand Down
18 changes: 17 additions & 1 deletion mermaid/mmd/er.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ erDiagram
string title
string changelog
boolean published "should be uneditable after publish"
string doi "identifier part only - fairhub.1234567"
string doi "10.36478/fairhub.10230"
int identifier "autoincrement | unique"
timestamp updated_on
timestamp created_at
Expand Down Expand Up @@ -109,6 +109,22 @@ erDiagram
timestamp created_at
}

PUBLISHED_DATASET {
string id PK "VERSION.identifier"
string study_id "STUDY.id"
string dataset_id "DATASET.id"
string version_id "VERSION.id"
string doi
string title "DATASET.title"
string description "DATASET.description"
string version_title "VERSION.title"
string study_title "STUDY.title"
json metadata
json files
json data "anything not in metadata"
timestamp created_at
}


STUDY_CONTRIBUTOR }o--|| STUDY : contributes
INVITE }o--|| STUDY : "invited to"
Expand Down
27 changes: 27 additions & 0 deletions mermaid/mmd/study-metadata-er.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,30 @@ erDiagram
number size "size of the files in the data lake"
}

STUDY_DASHBOARD {
string id PK
string study_id FK "STUDY.id"
string redcap_id FK "STUDY_REDCAP.id"
string name "NULLABLE"
json modules
int redcap_pid
json reports
timestamp created_at
timestamp updated_on
}

STUDY_REDCAP {
string id PK
string study_id FK "STUDY.id"
string title "NULLABLE"
int api_pid
string api_url
string api_key
boolean api_active
timestamp created_at
timestamp updated_on
}


STUDY_STATUS ||--|| STUDY : "is described by"
STUDY_SPONSORS_COLLOBORATORS ||--|| STUDY : "sponsors"
Expand All @@ -196,4 +220,7 @@ erDiagram
STUDY ||--o{ STUDY_LINK : "links to"
STUDY ||--o{ STUDY_AVAILABLE_IPD : "links to"

STUDY ||--o{ STUDY_DASHBOARD : "has dashboard"
STUDY ||--o{ STUDY_REDCAP : "has redcap API"

STUDY ||--|| STUDY_OTHER : "has other information"
2 changes: 1 addition & 1 deletion mermaid/svg/dataset-metadata-er.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mermaid/svg/er.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mermaid/svg/study-metadata-er.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion mermaid/svg/study-metadata.svg

This file was deleted.

0 comments on commit 80ef3bb

Please sign in to comment.