-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.dbml
82 lines (71 loc) · 1.53 KB
/
schema.dbml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// visualise at https://dbdiagram.io/d
Table studies {
citekey character [pk]
title character
lead_author character
other_authors character
year int
doi character
journal character
book character
}
Table sites {
site_name character [pk]
lat decimal
lon decimal
water_depth decimal
ocean_basin ocean_basin
}
Table samples {
site_name character
depth_in_core decimal
age decimal
taxon_id character
citekey character
data_url character
d18o decimal
d13c decimal
// composite primary key
indexes {
(site_name, age, taxon_id) [pk]
}
}
Table taxa {
taxon_id character [pk]
grouping character
genus character
species character
type character
habitat habitat
original_name character
}
Table env {
site_name character [pk]
chl_a_modern decimal
}
// possible codes for ocean basins
Enum ocean_basin {
NEAt // Northeast Atlantic Ocean
Med // Mediterranean Sea
NWAt // Northwest Atlantic Ocean
TAt // Tropical Atlantic Ocean
SAt // South Atlantic Ocean
NEPa // Northeast Pacific Ocean
NWPa // Northwest Pacific Ocean
TPa // Tropical Pacific Ocean
SPa // South Pacific Ocean
EIn // Eastern Indian Ocean
WIn // Western Indian Ocean
ESo // Eastern Southern Ocean
WSo // Western Southern Ocean
Ar // Arctic Ocean
}
// habitat is either benthic or planktonic
Enum habitat {
Bn // benthic
Pl // planktic
}
Ref: samples.citekey > studies.citekey
Ref: samples.site_name > sites.site_name
Ref: taxa.taxon_id < samples.taxon_id
Ref: env.site_name - sites.site_name