Revision 537
Added by Aaron Marcuse-Kubitza about 13 years ago
schemas/vegbien.for_ERD.my.sql | ||
---|---|---|
1 |
-- Existing tables |
|
2 |
|
|
3 |
CREATE TABLE aux_role |
|
4 |
( |
|
5 |
role_id int(11) NOT NULL AUTO_INCREMENT, |
|
6 |
rolecode character varying(30) NOT NULL, |
|
7 |
roledescription character varying(200), |
|
8 |
CONSTRAINT aux_role_pkey PRIMARY KEY (role_id ) |
|
9 |
); |
|
10 |
|
|
11 |
CREATE TABLE reference |
|
12 |
( |
|
13 |
reference_id int(11) NOT NULL AUTO_INCREMENT, |
|
14 |
shortname character varying(250), |
|
15 |
fulltext__ text, |
|
16 |
referencetype character varying(250) |
|
17 |
); |
|
18 |
|
|
19 |
CREATE TABLE party |
|
20 |
( |
|
21 |
party_id int(11) NOT NULL AUTO_INCREMENT, |
|
22 |
salutation character varying(20), |
|
23 |
givenname character varying(50), |
|
24 |
middlename character varying(50), |
|
25 |
surname character varying(50), |
|
26 |
organizationname character varying(100) |
|
27 |
); |
|
28 |
|
|
29 |
CREATE TABLE plantname |
|
30 |
( |
|
31 |
plantname_id int(11) NOT NULL AUTO_INCREMENT, |
|
32 |
plantname character varying(255) NOT NULL, |
|
33 |
reference_id int(11), |
|
34 |
dateentered timestamp DEFAULT now(), |
|
35 |
CONSTRAINT plantname_pkey PRIMARY KEY (plantname_id ), |
|
36 |
CONSTRAINT plantname_reference_id FOREIGN KEY (reference_id) |
|
37 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
38 |
ON UPDATE CASCADE ON DELETE CASCADE |
|
39 |
); |
|
40 |
|
|
41 |
CREATE TABLE plantconcept |
|
42 |
( |
|
43 |
plantconcept_id int(11) NOT NULL AUTO_INCREMENT, |
|
44 |
plantname_id int(11) NOT NULL, |
|
45 |
reference_id int(11) NOT NULL, |
|
46 |
plantname character varying(200), |
|
47 |
plantcode character varying(23), |
|
48 |
plantdescription text, |
|
49 |
d_obscount int(11), |
|
50 |
d_currentaccepted int(1), |
|
51 |
accessioncode character varying(255), |
|
52 |
CONSTRAINT plantconcept_pkey PRIMARY KEY (plantconcept_id ), |
|
53 |
CONSTRAINT plantconcept_plantname_id FOREIGN KEY (plantname_id) |
|
54 |
REFERENCES plantname (plantname_id) MATCH SIMPLE |
|
55 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
56 |
CONSTRAINT plantconcept_reference_id FOREIGN KEY (reference_id) |
|
57 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
58 |
ON UPDATE CASCADE ON DELETE CASCADE |
|
59 |
); |
|
60 |
|
|
61 |
CREATE TABLE namedplace |
|
62 |
( |
|
63 |
namedplace_id int(11) NOT NULL AUTO_INCREMENT, |
|
64 |
placesystem character varying(50), |
|
65 |
placename character varying(100) NOT NULL, |
|
66 |
placedescription text, |
|
67 |
placecode character varying(15), |
|
68 |
owner character varying(100), |
|
69 |
reference_id int(11), |
|
70 |
d_obscount int(11), |
|
71 |
accessioncode character varying(255), |
|
72 |
CONSTRAINT namedplace_pkey PRIMARY KEY (namedplace_id ), |
|
73 |
CONSTRAINT namedplace_reference_id FOREIGN KEY (reference_id) |
|
74 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
75 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
76 |
CONSTRAINT namedplace_keys UNIQUE (placesystem , placename ) |
|
77 |
); |
|
78 |
|
|
79 |
CREATE TABLE project |
|
80 |
( |
|
81 |
project_id int(11) NOT NULL AUTO_INCREMENT, |
|
82 |
projectname character varying(150) NOT NULL, |
|
83 |
projectdescription text, |
|
84 |
startdate timestamp, |
|
85 |
stopdate timestamp, |
|
86 |
d_obscount int(11), |
|
87 |
d_lastlocationaddeddate timestamp, |
|
88 |
accessioncode character varying(255), |
|
89 |
CONSTRAINT project_pkey PRIMARY KEY (project_id ), |
|
90 |
CONSTRAINT project_keys UNIQUE (projectname , startdate , stopdate ) |
|
91 |
); |
|
92 |
|
|
93 |
-- New tables |
|
94 |
|
|
1 | 95 |
CREATE TABLE location |
2 | 96 |
( |
3 | 97 |
location_id int(11) NOT NULL AUTO_INCREMENT, |
... | ... | |
139 | 233 |
CONSTRAINT stem_keys UNIQUE (individualplant_id , sourceid ) |
140 | 234 |
); |
141 | 235 |
|
236 |
CREATE TABLE specimen -- A herbarium specimen. Contains Darwin Core specimen data. |
|
237 |
( |
|
238 |
specimen_id int(11) NOT NULL AUTO_INCREMENT, |
|
239 |
individualplant_id int(11), |
|
240 |
reference_id int(11) NOT NULL, |
|
241 |
collectioncode_dwc character varying(255), |
|
242 |
catalognumber_dwc character varying(255), |
|
243 |
collectiondate timestamp, |
|
244 |
collector_id int(11), |
|
245 |
museum_id int(11), |
|
246 |
sourceaccessionnumber character varying(100), |
|
247 |
accessioncode character varying(255), |
|
248 |
taxonoccurrence_id int(11), |
|
249 |
CONSTRAINT specimen_pkey PRIMARY KEY (specimen_id ), |
|
250 |
CONSTRAINT specimen_collector_id FOREIGN KEY (collector_id) |
|
251 |
REFERENCES party (party_id) MATCH SIMPLE |
|
252 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
253 |
CONSTRAINT specimen_individualplant_id_fkey FOREIGN KEY (individualplant_id) |
|
254 |
REFERENCES individualplant (individualplant_id) MATCH SIMPLE |
|
255 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
256 |
CONSTRAINT specimen_museum_id FOREIGN KEY (museum_id) |
|
257 |
REFERENCES party (party_id) MATCH SIMPLE |
|
258 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
259 |
CONSTRAINT specimen_reference_id_fkey FOREIGN KEY (reference_id) |
|
260 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
261 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
262 |
CONSTRAINT specimen_taxonoccurrence_id FOREIGN KEY (taxonoccurrence_id) |
|
263 |
REFERENCES taxonoccurrence (taxonoccurrence_id) MATCH SIMPLE |
|
264 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
265 |
CONSTRAINT specimen_keys UNIQUE (reference_id , collectioncode_dwc , catalognumber_dwc ) |
|
266 |
); |
|
267 |
|
|
142 | 268 |
CREATE TABLE taxondetermination -- VegBank's taxoninterpretation table. |
143 | 269 |
( |
144 | 270 |
taxondetermination_id int(11) NOT NULL AUTO_INCREMENT, |
... | ... | |
157 | 283 |
notespublic int(1), |
158 | 284 |
notesmgt int(1), |
159 | 285 |
revisions int(1), |
160 |
determinationdate timestamp with time zone NOT NULL,
|
|
286 |
determinationdate timestamp NOT NULL, |
|
161 | 287 |
emb_taxondetermination int(11), |
162 | 288 |
accessioncode character varying(255), |
163 | 289 |
CONSTRAINT taxondetermination_pkey PRIMARY KEY (taxondetermination_id ), |
... | ... | |
178 | 304 |
ON UPDATE CASCADE ON DELETE CASCADE |
179 | 305 |
); |
180 | 306 |
|
181 |
CREATE TABLE specimen -- A herbarium specimen. Contains Darwin Core specimen data.
|
|
307 |
CREATE TABLE sizeclass -- A range of size measurements used to aggregate organisms.
|
|
182 | 308 |
( |
183 |
specimen_id int(11) NOT NULL AUTO_INCREMENT, |
|
184 |
individualplant_id int(11), |
|
185 |
reference_id int(11) NOT NULL, |
|
186 |
collectioncode_dwc character varying(255), |
|
187 |
catalognumber_dwc character varying(255), |
|
188 |
collectiondate timestamp with time zone, |
|
189 |
collector_id int(11), |
|
190 |
museum_id int(11), |
|
191 |
sourceaccessionnumber character varying(100), |
|
309 |
sizeclass_id int(11) NOT NULL AUTO_INCREMENT, |
|
310 |
mindiameter double precision, |
|
311 |
diameteraccuracy double precision, |
|
312 |
minheight double precision, |
|
313 |
heightaccuracy double precision, |
|
314 |
maxdiameter double precision, |
|
315 |
maxheight double precision, |
|
192 | 316 |
accessioncode character varying(255), |
193 |
taxonoccurrence_id int(11), |
|
194 |
CONSTRAINT specimen_pkey PRIMARY KEY (specimen_id ), |
|
195 |
CONSTRAINT specimen_collector_id FOREIGN KEY (collector_id) |
|
196 |
REFERENCES party (party_id) MATCH SIMPLE |
|
197 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
198 |
CONSTRAINT specimen_individualplant_id_fkey FOREIGN KEY (individualplant_id) |
|
199 |
REFERENCES individualplant (individualplant_id) MATCH SIMPLE |
|
200 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
201 |
CONSTRAINT specimen_museum_id FOREIGN KEY (museum_id) |
|
202 |
REFERENCES party (party_id) MATCH SIMPLE |
|
203 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
204 |
CONSTRAINT specimen_reference_id_fkey FOREIGN KEY (reference_id) |
|
205 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
206 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
207 |
CONSTRAINT specimen_taxonoccurrence_id FOREIGN KEY (taxonoccurrence_id) |
|
208 |
REFERENCES taxonoccurrence (taxonoccurrence_id) MATCH SIMPLE |
|
209 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
210 |
CONSTRAINT specimen_keys UNIQUE (reference_id , collectioncode_dwc , catalognumber_dwc ) |
|
317 |
CONSTRAINT sizeclass_pkey PRIMARY KEY (sizeclass_id ) |
|
211 | 318 |
); |
212 | 319 |
|
213 | 320 |
CREATE TABLE taxonbin -- Defines a set of aggregate measurements. Used by aggregateoccurrence to define how measurements were aggregated. |
... | ... | |
223 | 330 |
REFERENCES sizeclass (sizeclass_id) MATCH SIMPLE |
224 | 331 |
ON UPDATE CASCADE ON DELETE CASCADE |
225 | 332 |
); |
226 |
|
|
227 |
CREATE TABLE sizeclass -- A range of size measurements used to aggregate organisms. |
|
228 |
( |
|
229 |
sizeclass_id int(11) NOT NULL AUTO_INCREMENT, |
|
230 |
mindiameter double precision, |
|
231 |
diameteraccuracy double precision, |
|
232 |
minheight double precision, |
|
233 |
heightaccuracy double precision, |
|
234 |
maxdiameter double precision, |
|
235 |
maxheight double precision, |
|
236 |
accessioncode character varying(255), |
|
237 |
CONSTRAINT sizeclass_pkey PRIMARY KEY (sizeclass_id ) |
|
238 |
); |
schemas/vegbien.my.sql | ||
---|---|---|
42 | 42 |
postalcode character varying(10), |
43 | 43 |
country character varying(50), |
44 | 44 |
currentflag int(1), |
45 |
addressstartdate timestamp with time zone
|
|
45 |
addressstartdate timestamp |
|
46 | 46 |
); |
47 | 47 |
|
48 | 48 |
|
... | ... | |
195 | 195 |
commcode character varying(200), |
196 | 196 |
commframework character varying(200), |
197 | 197 |
commlevel character varying(200), |
198 |
classstartdate timestamp with time zone,
|
|
199 |
classstopdate timestamp with time zone,
|
|
198 |
classstartdate timestamp, |
|
199 |
classstopdate timestamp, |
|
200 | 200 |
emb_commclass int(11), |
201 | 201 |
expertsystem text, |
202 | 202 |
accessioncode character varying(255) |
... | ... | |
266 | 266 |
commstatus_id int(11) NOT NULL, |
267 | 267 |
commconcept_id int(11) NOT NULL, |
268 | 268 |
commconvergence character varying(20) NOT NULL, |
269 |
correlationstart timestamp with time zone NOT NULL,
|
|
270 |
correlationstop timestamp with time zone
|
|
269 |
correlationstart timestamp NOT NULL, |
|
270 |
correlationstop timestamp |
|
271 | 271 |
); |
272 | 272 |
|
273 | 273 |
|
... | ... | |
367 | 367 |
commname_id int(11) NOT NULL, |
368 | 368 |
commname text NOT NULL, |
369 | 369 |
reference_id int(11), |
370 |
dateentered timestamp with time zone DEFAULT now()
|
|
370 |
dateentered timestamp DEFAULT now() |
|
371 | 371 |
); |
372 | 372 |
|
373 | 373 |
|
... | ... | |
403 | 403 |
commlevel character varying(80), |
404 | 404 |
commpartycomments text, |
405 | 405 |
party_id int(11) NOT NULL, |
406 |
startdate timestamp with time zone NOT NULL,
|
|
407 |
stopdate timestamp with time zone,
|
|
406 |
startdate timestamp NOT NULL, |
|
407 |
stopdate timestamp, |
|
408 | 408 |
accessioncode character varying(255) |
409 | 409 |
); |
410 | 410 |
|
... | ... | |
441 | 441 |
classsystem character varying(50), |
442 | 442 |
party_id int(11), |
443 | 443 |
commstatus_id int(11), |
444 |
usagestart timestamp with time zone,
|
|
445 |
usagestop timestamp with time zone
|
|
444 |
usagestart timestamp, |
|
445 |
usagestop timestamp |
|
446 | 446 |
); |
447 | 447 |
|
448 | 448 |
|
... | ... | |
659 | 659 |
CREATE TABLE dba_datamodelversion ( |
660 | 660 |
dba_datamodelversion_id int(11) NOT NULL, |
661 | 661 |
versiontext character varying(20) NOT NULL, |
662 |
versionimplemented timestamp with time zone DEFAULT now()
|
|
662 |
versionimplemented timestamp DEFAULT now() |
|
663 | 663 |
); |
664 | 664 |
|
665 | 665 |
|
... | ... | |
690 | 690 |
|
691 | 691 |
CREATE TABLE dba_dbstatstime ( |
692 | 692 |
stat_id int(11) NOT NULL, |
693 |
statdate timestamp with time zone,
|
|
693 |
statdate timestamp, |
|
694 | 694 |
statpkg int(11), |
695 | 695 |
statname text, |
696 | 696 |
stattable character varying(100), |
... | ... | |
988 | 988 |
location_id int(11) NOT NULL, |
989 | 989 |
embargoreason text NOT NULL, |
990 | 990 |
defaultstatus int(11) NOT NULL, |
991 |
embargostart timestamp with time zone NOT NULL,
|
|
992 |
embargostop timestamp with time zone NOT NULL
|
|
991 |
embargostart timestamp NOT NULL, |
|
992 |
embargostop timestamp NOT NULL |
|
993 | 993 |
); |
994 | 994 |
|
995 | 995 |
|
... | ... | |
1024 | 1024 |
graphicdescription text, |
1025 | 1025 |
graphictype character varying(20), |
1026 | 1026 |
graphicdata oid, |
1027 |
graphicdate timestamp with time zone,
|
|
1027 |
graphicdate timestamp, |
|
1028 | 1028 |
accessioncode character varying(255) |
1029 | 1029 |
); |
1030 | 1030 |
|
... | ... | |
1163 | 1163 |
notespublic int(1), |
1164 | 1164 |
notesmgt int(1), |
1165 | 1165 |
revisions int(1), |
1166 |
dateentered timestamp with time zone DEFAULT now(),
|
|
1166 |
dateentered timestamp DEFAULT now(), |
|
1167 | 1167 |
emb_location int(11), |
1168 | 1168 |
locationrationalenarrative text, |
1169 | 1169 |
accessioncode character varying(255), |
... | ... | |
1266 | 1266 |
notespublic int(1), |
1267 | 1267 |
notesmgt int(1), |
1268 | 1268 |
revisions int(1), |
1269 |
obsstartdate timestamp with time zone,
|
|
1270 |
obsenddate timestamp with time zone,
|
|
1271 |
dateentered timestamp with time zone DEFAULT now(),
|
|
1269 |
obsstartdate timestamp, |
|
1270 |
obsenddate timestamp, |
|
1271 |
dateentered timestamp DEFAULT now(), |
|
1272 | 1272 |
emb_locationevent int(11), |
1273 | 1273 |
interp_orig_ci_id int(11), |
1274 | 1274 |
interp_orig_cc_id int(11), |
... | ... | |
1333 | 1333 |
locationevent_id int(11) NOT NULL, |
1334 | 1334 |
party_id int(11) NOT NULL, |
1335 | 1335 |
role_id int(11) NOT NULL, |
1336 |
contributiondate timestamp with time zone
|
|
1336 |
contributiondate timestamp |
|
1337 | 1337 |
); |
1338 | 1338 |
|
1339 | 1339 |
|
... | ... | |
1367 | 1367 |
party_id int(11) NOT NULL, |
1368 | 1368 |
role_id int(11) NOT NULL, |
1369 | 1369 |
synonymcomment text, |
1370 |
classstartdate timestamp with time zone DEFAULT now() NOT NULL,
|
|
1371 |
classstopdate timestamp with time zone,
|
|
1370 |
classstartdate timestamp DEFAULT now() NOT NULL, |
|
1371 |
classstopdate timestamp, |
|
1372 | 1372 |
accessioncode character varying(255) |
1373 | 1373 |
); |
1374 | 1374 |
|
... | ... | |
1470 | 1470 |
role_id int(11) NOT NULL, |
1471 | 1471 |
notetype character varying(20) NOT NULL, |
1472 | 1472 |
notetext text NOT NULL, |
1473 |
notedate timestamp with time zone,
|
|
1473 |
notedate timestamp, |
|
1474 | 1474 |
accessioncode character varying(255) |
1475 | 1475 |
); |
1476 | 1476 |
|
... | ... | |
1574 | 1574 |
parentparty_id int(11) NOT NULL, |
1575 | 1575 |
childparty_id int(11) NOT NULL, |
1576 | 1576 |
role_id int(11), |
1577 |
memberstart timestamp with time zone DEFAULT now() NOT NULL,
|
|
1578 |
memberstop timestamp with time zone
|
|
1577 |
memberstart timestamp DEFAULT now() NOT NULL, |
|
1578 |
memberstop timestamp |
|
1579 | 1579 |
); |
1580 | 1580 |
|
1581 | 1581 |
|
... | ... | |
1674 | 1674 |
plantstatus_id int(11) NOT NULL, |
1675 | 1675 |
plantconcept_id int(11) NOT NULL, |
1676 | 1676 |
plantconvergence character varying(20) NOT NULL, |
1677 |
correlationstart timestamp with time zone NOT NULL,
|
|
1678 |
correlationstop timestamp with time zone
|
|
1677 |
correlationstart timestamp NOT NULL, |
|
1678 |
correlationstop timestamp |
|
1679 | 1679 |
); |
1680 | 1680 |
|
1681 | 1681 |
|
... | ... | |
1736 | 1736 |
plantname_id int(11) NOT NULL, |
1737 | 1737 |
plantname character varying(255) NOT NULL, |
1738 | 1738 |
reference_id int(11), |
1739 |
dateentered timestamp with time zone DEFAULT now()
|
|
1739 |
dateentered timestamp DEFAULT now() |
|
1740 | 1740 |
); |
1741 | 1741 |
|
1742 | 1742 |
|
... | ... | |
1774 | 1774 |
plantparent_id int(11), |
1775 | 1775 |
plantlevel character varying(80), |
1776 | 1776 |
party_id int(11) NOT NULL, |
1777 |
startdate timestamp with time zone NOT NULL,
|
|
1778 |
stopdate timestamp with time zone,
|
|
1777 |
startdate timestamp NOT NULL, |
|
1778 |
stopdate timestamp, |
|
1779 | 1779 |
accessioncode character varying(255) |
1780 | 1780 |
); |
1781 | 1781 |
|
... | ... | |
1813 | 1813 |
acceptedsynonym character varying(220), |
1814 | 1814 |
party_id int(11), |
1815 | 1815 |
plantstatus_id int(11), |
1816 |
usagestart timestamp with time zone,
|
|
1817 |
usagestop timestamp with time zone
|
|
1816 |
usagestart timestamp, |
|
1817 |
usagestop timestamp |
|
1818 | 1818 |
); |
1819 | 1819 |
|
1820 | 1820 |
|
... | ... | |
1845 | 1845 |
project_id int(11) NOT NULL, |
1846 | 1846 |
projectname character varying(150) NOT NULL, |
1847 | 1847 |
projectdescription text, |
1848 |
startdate timestamp with time zone,
|
|
1849 |
stopdate timestamp with time zone,
|
|
1848 |
startdate timestamp, |
|
1849 |
stopdate timestamp, |
|
1850 | 1850 |
d_obscount int(11), |
1851 |
d_lastlocationaddeddate timestamp with time zone,
|
|
1851 |
d_lastlocationaddeddate timestamp, |
|
1852 | 1852 |
accessioncode character varying(255) |
1853 | 1853 |
); |
1854 | 1854 |
|
... | ... | |
1912 | 1912 |
CREATE TABLE reference ( |
1913 | 1913 |
reference_id int(11) NOT NULL, |
1914 | 1914 |
shortname character varying(250), |
1915 |
fulltext text, |
|
1915 |
fulltext__ text,
|
|
1916 | 1916 |
referencetype character varying(250), |
1917 | 1917 |
title character varying(250), |
1918 | 1918 |
titlesuperior character varying(250), |
... | ... | |
1933 | 1933 |
url text, |
1934 | 1934 |
doi text, |
1935 | 1935 |
additionalinfo text, |
1936 |
pubdate timestamp with time zone,
|
|
1937 |
accessdate timestamp with time zone,
|
|
1938 |
conferencedate timestamp with time zone,
|
|
1936 |
pubdate timestamp, |
|
1937 |
accessdate timestamp, |
|
1938 |
conferencedate timestamp, |
|
1939 | 1939 |
accessioncode character varying(255) |
1940 | 1940 |
); |
1941 | 1941 |
|
... | ... | |
2103 | 2103 |
previousvaluetext text NOT NULL, |
2104 | 2104 |
previousvaluetype character varying(20) NOT NULL, |
2105 | 2105 |
previousrevision_id int(11), |
2106 |
revisiondate timestamp with time zone NOT NULL
|
|
2106 |
revisiondate timestamp NOT NULL |
|
2107 | 2107 |
); |
2108 | 2108 |
|
2109 | 2109 |
|
... | ... | |
2262 | 2262 |
reference_id int(11) NOT NULL, |
2263 | 2263 |
collectioncode_dwc character varying(255), |
2264 | 2264 |
catalognumber_dwc character varying(255), |
2265 |
collectiondate timestamp with time zone,
|
|
2265 |
collectiondate timestamp, |
|
2266 | 2266 |
collector_id int(11), |
2267 | 2267 |
museum_id int(11), |
2268 | 2268 |
sourceaccessionnumber character varying(100), |
... | ... | |
2522 | 2522 |
notespublic int(1), |
2523 | 2523 |
notesmgt int(1), |
2524 | 2524 |
revisions int(1), |
2525 |
determinationdate timestamp with time zone NOT NULL,
|
|
2525 |
determinationdate timestamp NOT NULL, |
|
2526 | 2526 |
emb_taxondetermination int(11), |
2527 | 2527 |
accessioncode character varying(255) |
2528 | 2528 |
); |
... | ... | |
2813 | 2813 |
datasettype character varying(50), |
2814 | 2814 |
datasetsharing character varying(30), |
2815 | 2815 |
datasetpassword character varying(50), |
2816 |
datasetstop timestamp with time zone,
|
|
2817 |
datasetstart timestamp with time zone DEFAULT now(),
|
|
2816 |
datasetstop timestamp, |
|
2817 |
datasetstart timestamp DEFAULT now(), |
|
2818 | 2818 |
accessioncode character varying(255) |
2819 | 2819 |
); |
2820 | 2820 |
|
... | ... | |
2848 | 2848 |
itemaccessioncode character varying(100) NOT NULL, |
2849 | 2849 |
itemtype character varying(50), |
2850 | 2850 |
notes text, |
2851 |
itemstart timestamp with time zone DEFAULT now() NOT NULL,
|
|
2852 |
itemstop timestamp with time zone,
|
|
2851 |
itemstart timestamp DEFAULT now() NOT NULL, |
|
2852 |
itemstop timestamp, |
|
2853 | 2853 |
externalaccessioncode character varying(100), |
2854 | 2854 |
itemdatabase character varying(50) NOT NULL, |
2855 | 2855 |
itemtable character varying(50) NOT NULL, |
... | ... | |
2920 | 2920 |
notifyname character varying(100), |
2921 | 2921 |
notifydescription text, |
2922 | 2922 |
notifysql text, |
2923 |
notifystart timestamp with time zone DEFAULT now(),
|
|
2924 |
notifystop timestamp with time zone,
|
|
2925 |
lastcheckdate timestamp with time zone
|
|
2923 |
notifystart timestamp DEFAULT now(), |
|
2924 |
notifystop timestamp, |
|
2925 |
lastcheckdate timestamp |
|
2926 | 2926 |
); |
2927 | 2927 |
|
2928 | 2928 |
|
... | ... | |
2955 | 2955 |
usr_id int(11) NOT NULL, |
2956 | 2956 |
permissionstatus int(11) NOT NULL, |
2957 | 2957 |
permissionnotes text, |
2958 |
permissionstop timestamp with time zone,
|
|
2959 |
permissionstart timestamp with time zone DEFAULT now() NOT NULL
|
|
2958 |
permissionstop timestamp, |
|
2959 |
permissionstart timestamp DEFAULT now() NOT NULL |
|
2960 | 2960 |
); |
2961 | 2961 |
|
2962 | 2962 |
|
... | ... | |
2989 | 2989 |
preferencename character varying(100), |
2990 | 2990 |
preferencevalue text, |
2991 | 2991 |
preferencepriority double precision, |
2992 |
preferencestop timestamp with time zone,
|
|
2993 |
preferencestart timestamp with time zone DEFAULT now()
|
|
2992 |
preferencestop timestamp, |
|
2993 |
preferencestart timestamp DEFAULT now() |
|
2994 | 2994 |
); |
2995 | 2995 |
|
2996 | 2996 |
|
... | ... | |
3026 | 3026 |
querytype character varying(50), |
3027 | 3027 |
querysharing character varying(30), |
3028 | 3028 |
querypassword character varying(50), |
3029 |
querystop timestamp with time zone,
|
|
3030 |
querystart timestamp with time zone DEFAULT now(),
|
|
3029 |
querystop timestamp, |
|
3030 |
querystart timestamp DEFAULT now(), |
|
3031 | 3031 |
accessioncode character varying(255) |
3032 | 3032 |
); |
3033 | 3033 |
|
... | ... | |
3061 | 3061 |
tablename character varying(50) NOT NULL, |
3062 | 3062 |
tablerecord int(11) NOT NULL, |
3063 | 3063 |
ownertype character varying(30) NOT NULL, |
3064 |
recordcreationdate timestamp with time zone NOT NULL,
|
|
3065 |
ownerstop timestamp with time zone,
|
|
3066 |
ownerstart timestamp with time zone DEFAULT now() NOT NULL
|
|
3064 |
recordcreationdate timestamp NOT NULL, |
|
3065 |
ownerstop timestamp, |
|
3066 |
ownerstart timestamp DEFAULT now() NOT NULL |
|
3067 | 3067 |
); |
3068 | 3068 |
|
3069 | 3069 |
|
... | ... | |
3131 | 3131 |
email_address character varying(100) NOT NULL, |
3132 | 3132 |
preferred_name character varying(100), |
3133 | 3133 |
remote_address character varying(100), |
3134 |
last_connect timestamp with time zone,
|
|
3135 |
begin_time timestamp with time zone,
|
|
3134 |
last_connect timestamp, |
|
3135 |
begin_time timestamp, |
|
3136 | 3136 |
password character varying(512) |
3137 | 3137 |
); |
3138 | 3138 |
|
schemas/vegbien.for_ERD.sql | ||
---|---|---|
1 |
-- Existing tables |
|
2 |
|
|
3 |
CREATE TABLE aux_role |
|
4 |
( |
|
5 |
role_id serial NOT NULL, |
|
6 |
rolecode character varying(30) NOT NULL, |
|
7 |
roledescription character varying(200), |
|
8 |
CONSTRAINT aux_role_pkey PRIMARY KEY (role_id ) |
|
9 |
); |
|
10 |
|
|
11 |
CREATE TABLE reference |
|
12 |
( |
|
13 |
reference_id serial NOT NULL, |
|
14 |
shortname character varying(250), |
|
15 |
fulltext text, |
|
16 |
referencetype character varying(250) |
|
17 |
); |
|
18 |
|
|
19 |
CREATE TABLE party |
|
20 |
( |
|
21 |
party_id serial NOT NULL, |
|
22 |
salutation character varying(20), |
|
23 |
givenname character varying(50), |
|
24 |
middlename character varying(50), |
|
25 |
surname character varying(50), |
|
26 |
organizationname character varying(100) |
|
27 |
); |
|
28 |
|
|
29 |
CREATE TABLE plantname |
|
30 |
( |
|
31 |
plantname_id serial NOT NULL, |
|
32 |
plantname character varying(255) NOT NULL, |
|
33 |
reference_id integer, |
|
34 |
dateentered timestamp with time zone DEFAULT now(), |
|
35 |
CONSTRAINT plantname_pkey PRIMARY KEY (plantname_id ), |
|
36 |
CONSTRAINT plantname_reference_id FOREIGN KEY (reference_id) |
|
37 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
38 |
ON UPDATE CASCADE ON DELETE CASCADE |
|
39 |
); |
|
40 |
|
|
41 |
CREATE TABLE plantconcept |
|
42 |
( |
|
43 |
plantconcept_id serial NOT NULL, |
|
44 |
plantname_id integer NOT NULL, |
|
45 |
reference_id integer NOT NULL, |
|
46 |
plantname character varying(200), |
|
47 |
plantcode character varying(23), |
|
48 |
plantdescription text, |
|
49 |
d_obscount integer, |
|
50 |
d_currentaccepted boolean, |
|
51 |
accessioncode character varying(255), |
|
52 |
CONSTRAINT plantconcept_pkey PRIMARY KEY (plantconcept_id ), |
|
53 |
CONSTRAINT plantconcept_plantname_id FOREIGN KEY (plantname_id) |
|
54 |
REFERENCES plantname (plantname_id) MATCH SIMPLE |
|
55 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
56 |
CONSTRAINT plantconcept_reference_id FOREIGN KEY (reference_id) |
|
57 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
58 |
ON UPDATE CASCADE ON DELETE CASCADE |
|
59 |
); |
|
60 |
|
|
61 |
CREATE TABLE namedplace |
|
62 |
( |
|
63 |
namedplace_id serial NOT NULL, |
|
64 |
placesystem character varying(50), |
|
65 |
placename character varying(100) NOT NULL, |
|
66 |
placedescription text, |
|
67 |
placecode character varying(15), |
|
68 |
owner character varying(100), |
|
69 |
reference_id integer, |
|
70 |
d_obscount integer, |
|
71 |
accessioncode character varying(255), |
|
72 |
CONSTRAINT namedplace_pkey PRIMARY KEY (namedplace_id ), |
|
73 |
CONSTRAINT namedplace_reference_id FOREIGN KEY (reference_id) |
|
74 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
75 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
76 |
CONSTRAINT namedplace_keys UNIQUE (placesystem , placename ) |
|
77 |
); |
|
78 |
|
|
79 |
CREATE TABLE project |
|
80 |
( |
|
81 |
project_id serial NOT NULL, |
|
82 |
projectname character varying(150) NOT NULL, |
|
83 |
projectdescription text, |
|
84 |
startdate timestamp with time zone, |
|
85 |
stopdate timestamp with time zone, |
|
86 |
d_obscount integer, |
|
87 |
d_lastlocationaddeddate timestamp with time zone, |
|
88 |
accessioncode character varying(255), |
|
89 |
CONSTRAINT project_pkey PRIMARY KEY (project_id ), |
|
90 |
CONSTRAINT project_keys UNIQUE (projectname , startdate , stopdate ) |
|
91 |
); |
|
92 |
|
|
93 |
-- New tables |
|
94 |
|
|
1 | 95 |
CREATE TABLE location |
2 | 96 |
( |
3 | 97 |
location_id serial NOT NULL, |
... | ... | |
139 | 233 |
CONSTRAINT stem_keys UNIQUE (individualplant_id , sourceid ) |
140 | 234 |
); |
141 | 235 |
|
236 |
CREATE TABLE specimen -- A herbarium specimen. Contains Darwin Core specimen data. |
|
237 |
( |
|
238 |
specimen_id serial NOT NULL, |
|
239 |
individualplant_id integer, |
|
240 |
reference_id integer NOT NULL, |
|
241 |
collectioncode_dwc character varying(255), |
|
242 |
catalognumber_dwc character varying(255), |
|
243 |
collectiondate timestamp with time zone, |
|
244 |
collector_id integer, |
|
245 |
museum_id integer, |
|
246 |
sourceaccessionnumber character varying(100), |
|
247 |
accessioncode character varying(255), |
|
248 |
taxonoccurrence_id integer, |
|
249 |
CONSTRAINT specimen_pkey PRIMARY KEY (specimen_id ), |
|
250 |
CONSTRAINT specimen_collector_id FOREIGN KEY (collector_id) |
|
251 |
REFERENCES party (party_id) MATCH SIMPLE |
|
252 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
253 |
CONSTRAINT specimen_individualplant_id_fkey FOREIGN KEY (individualplant_id) |
|
254 |
REFERENCES individualplant (individualplant_id) MATCH SIMPLE |
|
255 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
256 |
CONSTRAINT specimen_museum_id FOREIGN KEY (museum_id) |
|
257 |
REFERENCES party (party_id) MATCH SIMPLE |
|
258 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
259 |
CONSTRAINT specimen_reference_id_fkey FOREIGN KEY (reference_id) |
|
260 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
261 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
262 |
CONSTRAINT specimen_taxonoccurrence_id FOREIGN KEY (taxonoccurrence_id) |
|
263 |
REFERENCES taxonoccurrence (taxonoccurrence_id) MATCH SIMPLE |
|
264 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
265 |
CONSTRAINT specimen_keys UNIQUE (reference_id , collectioncode_dwc , catalognumber_dwc ) |
|
266 |
); |
|
267 |
|
|
142 | 268 |
CREATE TABLE taxondetermination -- VegBank's taxoninterpretation table. |
143 | 269 |
( |
144 | 270 |
taxondetermination_id serial NOT NULL, |
... | ... | |
178 | 304 |
ON UPDATE CASCADE ON DELETE CASCADE |
179 | 305 |
); |
180 | 306 |
|
181 |
CREATE TABLE specimen -- A herbarium specimen. Contains Darwin Core specimen data.
|
|
307 |
CREATE TABLE sizeclass -- A range of size measurements used to aggregate organisms.
|
|
182 | 308 |
( |
183 |
specimen_id serial NOT NULL, |
|
184 |
individualplant_id integer, |
|
185 |
reference_id integer NOT NULL, |
|
186 |
collectioncode_dwc character varying(255), |
|
187 |
catalognumber_dwc character varying(255), |
|
188 |
collectiondate timestamp with time zone, |
|
189 |
collector_id integer, |
|
190 |
museum_id integer, |
|
191 |
sourceaccessionnumber character varying(100), |
|
309 |
sizeclass_id serial NOT NULL, |
|
310 |
mindiameter double precision, |
|
311 |
diameteraccuracy double precision, |
|
312 |
minheight double precision, |
|
313 |
heightaccuracy double precision, |
|
314 |
maxdiameter double precision, |
|
315 |
maxheight double precision, |
|
192 | 316 |
accessioncode character varying(255), |
193 |
taxonoccurrence_id integer, |
|
194 |
CONSTRAINT specimen_pkey PRIMARY KEY (specimen_id ), |
|
195 |
CONSTRAINT specimen_collector_id FOREIGN KEY (collector_id) |
|
196 |
REFERENCES party (party_id) MATCH SIMPLE |
|
197 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
198 |
CONSTRAINT specimen_individualplant_id_fkey FOREIGN KEY (individualplant_id) |
|
199 |
REFERENCES individualplant (individualplant_id) MATCH SIMPLE |
|
200 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
201 |
CONSTRAINT specimen_museum_id FOREIGN KEY (museum_id) |
|
202 |
REFERENCES party (party_id) MATCH SIMPLE |
|
203 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
204 |
CONSTRAINT specimen_reference_id_fkey FOREIGN KEY (reference_id) |
|
205 |
REFERENCES reference (reference_id) MATCH SIMPLE |
|
206 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
207 |
CONSTRAINT specimen_taxonoccurrence_id FOREIGN KEY (taxonoccurrence_id) |
|
208 |
REFERENCES taxonoccurrence (taxonoccurrence_id) MATCH SIMPLE |
|
209 |
ON UPDATE CASCADE ON DELETE CASCADE, |
|
210 |
CONSTRAINT specimen_keys UNIQUE (reference_id , collectioncode_dwc , catalognumber_dwc ) |
|
317 |
CONSTRAINT sizeclass_pkey PRIMARY KEY (sizeclass_id ) |
|
211 | 318 |
); |
212 | 319 |
|
213 | 320 |
CREATE TABLE taxonbin -- Defines a set of aggregate measurements. Used by aggregateoccurrence to define how measurements were aggregated. |
... | ... | |
223 | 330 |
REFERENCES sizeclass (sizeclass_id) MATCH SIMPLE |
224 | 331 |
ON UPDATE CASCADE ON DELETE CASCADE |
225 | 332 |
); |
226 |
|
|
227 |
CREATE TABLE sizeclass -- A range of size measurements used to aggregate organisms. |
|
228 |
( |
|
229 |
sizeclass_id serial NOT NULL, |
|
230 |
mindiameter double precision, |
|
231 |
diameteraccuracy double precision, |
|
232 |
minheight double precision, |
|
233 |
heightaccuracy double precision, |
|
234 |
maxdiameter double precision, |
|
235 |
maxheight double precision, |
|
236 |
accessioncode character varying(255), |
|
237 |
CONSTRAINT sizeclass_pkey PRIMARY KEY (sizeclass_id ) |
|
238 |
); |
lib/PostgreSQL-MySQL.csv | ||
---|---|---|
1 | 1 |
"PostgreSQL","MySQL","Comments" |
2 |
"^--(?=\S)","$0 ",
|
|
2 |
"^--(?=\S)","\g<0> ",
|
|
3 | 3 |
"\bserial( NOT NULL\b)?","int(11)\1 AUTO_INCREMENT", |
4 | 4 |
"Integer","int(11)", |
5 | 5 |
"Boolean","int(1)", |
6 |
" with time zone\b","", |
|
7 |
"fulltext","\g<0>__" |
Also available in: Unified diff
PostgreSQL-MySQL.csv: Use \g<0> instead of \0 in replacements because \0 not supported. Replace fulltext with fulltext__ (note fulltext_ doesn't work).