Revision 5225
Added by Aaron Marcuse-Kubitza over 12 years ago
vegbien.sql | ||
---|---|---|
249 | 249 |
|
250 | 250 |
|
251 | 251 |
-- |
252 |
-- Name: _set_canon_taxonpath(integer, integer); Type: FUNCTION; Schema: public; Owner: -
|
|
252 |
-- Name: _set_canon_taxonconcept(integer, integer); Type: FUNCTION; Schema: public; Owner: -
|
|
253 | 253 |
-- |
254 | 254 |
|
255 |
CREATE FUNCTION _set_canon_taxonpath(taxonpath_id integer, canon_taxonpath_id integer) RETURNS integer
|
|
255 |
CREATE FUNCTION _set_canon_taxonconcept(taxonconcept_id integer, canon_taxonconcept_id integer) RETURNS integer
|
|
256 | 256 |
LANGUAGE sql |
257 | 257 |
AS $_$ |
258 |
UPDATE taxonpath SET canon_taxonpath_id = $2 WHERE taxonpath_id = $1
|
|
259 |
RETURNING taxonpath_id
|
|
258 |
UPDATE taxonconcept SET canon_taxonconcept_id = $2 WHERE taxonconcept_id = $1
|
|
259 |
RETURNING taxonconcept_id
|
|
260 | 260 |
$_$; |
261 | 261 |
|
262 | 262 |
|
... | ... | |
408 | 408 |
|
409 | 409 |
|
410 | 410 |
-- |
411 |
-- Name: taxonpath_canon_taxonpath_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
|
|
411 |
-- Name: taxonconcept_canon_taxonconcept_id_self_ref(); Type: FUNCTION; Schema: public; Owner: -
|
|
412 | 412 |
-- |
413 | 413 |
|
414 |
CREATE FUNCTION taxonpath_canon_taxonpath_id_self_ref() RETURNS trigger
|
|
414 |
CREATE FUNCTION taxonconcept_canon_taxonconcept_id_self_ref() RETURNS trigger
|
|
415 | 415 |
LANGUAGE plpgsql |
416 | 416 |
AS $$ |
417 | 417 |
BEGIN |
418 |
IF new.taxonpath_id IS NULL THEN -- prepopulate taxonpath_id
|
|
419 |
new.taxonpath_id = nextval('taxonpath_taxonpath_id_seq'::regclass);
|
|
418 |
IF new.taxonconcept_id IS NULL THEN -- prepopulate taxonconcept_id
|
|
419 |
new.taxonconcept_id = nextval('taxonconcept_taxonconcept_id_seq'::regclass);
|
|
420 | 420 |
END IF; |
421 |
IF new.canon_taxonpath_id = 0 THEN -- make self-reference
|
|
422 |
new.canon_taxonpath_id = new.taxonpath_id;
|
|
421 |
IF new.canon_taxonconcept_id = 0 THEN -- make self-reference
|
|
422 |
new.canon_taxonconcept_id = new.taxonconcept_id;
|
|
423 | 423 |
END IF; |
424 | 424 |
RETURN new; |
425 | 425 |
END; |
... | ... | |
1081 | 1081 |
|
1082 | 1082 |
|
1083 | 1083 |
-- |
1084 |
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1084 |
-- Name: taxonconcept; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1085 | 1085 |
-- |
1086 | 1086 |
|
1087 |
CREATE TABLE taxondetermination ( |
|
1088 |
taxondetermination_id integer NOT NULL, |
|
1089 |
taxonoccurrence_id integer NOT NULL, |
|
1090 |
taxonpath_id integer NOT NULL, |
|
1091 |
party_id integer, |
|
1092 |
role role DEFAULT 'unknown'::role NOT NULL, |
|
1093 |
determinationtype text, |
|
1094 |
reference_id integer, |
|
1095 |
isoriginal boolean DEFAULT false NOT NULL, |
|
1096 |
iscurrent boolean DEFAULT false NOT NULL, |
|
1097 |
taxonfit text, |
|
1098 |
taxonconfidence text, |
|
1099 |
grouptype text, |
|
1100 |
notes text, |
|
1101 |
notespublic boolean, |
|
1102 |
notesmgt boolean, |
|
1103 |
revisions boolean, |
|
1104 |
determinationdate timestamp with time zone, |
|
1105 |
accessioncode text |
|
1087 |
CREATE TABLE taxonconcept ( |
|
1088 |
taxonconcept_id integer NOT NULL, |
|
1089 |
datasource_id integer NOT NULL, |
|
1090 |
identifyingtaxonomicname text, |
|
1091 |
canon_taxonconcept_id integer, |
|
1092 |
taxon_id integer, |
|
1093 |
taxonomicname text, |
|
1094 |
author text, |
|
1095 |
taxonomicnamewithauthor text, |
|
1096 |
domain text, |
|
1097 |
kingdom text, |
|
1098 |
phylum text, |
|
1099 |
class text, |
|
1100 |
"order" text, |
|
1101 |
family text, |
|
1102 |
genus text, |
|
1103 |
species text, |
|
1104 |
subspecies text, |
|
1105 |
variety text, |
|
1106 |
forma text, |
|
1107 |
cultivar text, |
|
1108 |
morphospecies text, |
|
1109 |
otherranks rankedtaxonname[], |
|
1110 |
scope_id integer, |
|
1111 |
accessioncode text, |
|
1112 |
CONSTRAINT taxonconcept_required_key CHECK (((((((identifyingtaxonomicname IS NOT NULL) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR (family IS NOT NULL)) OR (genus IS NOT NULL)) OR (otherranks IS NOT NULL))) |
|
1106 | 1113 |
); |
1107 | 1114 |
|
1108 | 1115 |
|
1109 | 1116 |
-- |
1110 |
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
|
|
1117 |
-- Name: TABLE taxonconcept; Type: COMMENT; Schema: public; Owner: -
|
|
1111 | 1118 |
-- |
1112 | 1119 |
|
1113 |
COMMENT ON TABLE taxondetermination IS 'Equivalent to VegBank''s taxoninterpretation table.';
|
|
1120 |
COMMENT ON TABLE taxonconcept IS 'The full path to a taxon, including all components of the taxonomic name. Can be either verbatim or accepted. For accepted names, points to the identified taxon in the tree of life.
|
|
1114 | 1121 |
|
1122 |
To include a taxon name at a rank with no explicit column, add it to the otherranks array.'; |
|
1115 | 1123 |
|
1124 |
|
|
1116 | 1125 |
-- |
1117 |
-- Name: taxonoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1126 |
-- Name: COLUMN taxonconcept.identifyingtaxonomicname; Type: COMMENT; Schema: public; Owner: -
|
|
1118 | 1127 |
-- |
1119 | 1128 |
|
1120 |
CREATE TABLE taxonoccurrence ( |
|
1121 |
taxonoccurrence_id integer NOT NULL, |
|
1122 |
datasource_id integer NOT NULL, |
|
1123 |
sourceaccessioncode text, |
|
1124 |
locationevent_id integer, |
|
1125 |
authortaxoncode text, |
|
1126 |
verbatimcollectorname text, |
|
1127 |
growthform growthform, |
|
1128 |
iscultivated boolean, |
|
1129 |
cultivatedbasis text, |
|
1130 |
isnative boolean, |
|
1131 |
accessioncode text |
|
1132 |
); |
|
1129 |
COMMENT ON COLUMN taxonconcept.identifyingtaxonomicname IS 'The taxonomic name that uniquely identifies this taxonconcept. If set, the other fields will not be used in duplicate elimination.'; |
|
1133 | 1130 |
|
1134 | 1131 |
|
1135 | 1132 |
-- |
1136 |
-- Name: TABLE taxonoccurrence; Type: COMMENT; Schema: public; Owner: -
|
|
1133 |
-- Name: COLUMN taxonconcept.canon_taxonconcept_id; Type: COMMENT; Schema: public; Owner: -
|
|
1137 | 1134 |
-- |
1138 | 1135 |
|
1139 |
COMMENT ON TABLE taxonoccurrence IS 'Equivalent to VegBank''s taxonobservation table.';
|
|
1136 |
COMMENT ON COLUMN taxonconcept.canon_taxonconcept_id IS 'The taxonconcept containing the accepted name of this verbatim taxonomic name. taxonconcepts should be linked in a three-level hierarchy of datasource name -> concatenated name -> accepted name.
|
|
1140 | 1137 |
|
1138 |
An accepted name should point to itself in this field. This will happen automatically by setting it to the special value 0.'; |
|
1141 | 1139 |
|
1140 |
|
|
1142 | 1141 |
-- |
1143 |
-- Name: COLUMN taxonoccurrence.iscultivated; Type: COMMENT; Schema: public; Owner: -
|
|
1142 |
-- Name: COLUMN taxonconcept.taxon_id; Type: COMMENT; Schema: public; Owner: -
|
|
1144 | 1143 |
-- |
1145 | 1144 |
|
1146 |
COMMENT ON COLUMN taxonoccurrence.iscultivated IS 'cultivated or wild';
|
|
1145 |
COMMENT ON COLUMN taxonconcept.taxon_id IS 'The corresponding taxon in the tree of life. Only used for parsed names.';
|
|
1147 | 1146 |
|
1148 | 1147 |
|
1149 | 1148 |
-- |
1150 |
-- Name: COLUMN taxonoccurrence.cultivatedbasis; Type: COMMENT; Schema: public; Owner: -
|
|
1149 |
-- Name: COLUMN taxonconcept.taxonomicname; Type: COMMENT; Schema: public; Owner: -
|
|
1151 | 1150 |
-- |
1152 | 1151 |
|
1153 |
COMMENT ON COLUMN taxonoccurrence.cultivatedbasis IS 'The reason why a taxonoccurrence was marked as cultivated (or not).';
|
|
1152 |
COMMENT ON COLUMN taxonconcept.taxonomicname IS 'The concatenated taxonomic name which uniquely identifies this taxon. Does not include the author of the name.
|
|
1154 | 1153 |
|
1154 |
Equivalent to Darwin Core''s scientificName.'; |
|
1155 | 1155 |
|
1156 |
|
|
1156 | 1157 |
-- |
1157 |
-- Name: COLUMN taxonoccurrence.isnative; Type: COMMENT; Schema: public; Owner: -
|
|
1158 |
-- Name: COLUMN taxonconcept.author; Type: COMMENT; Schema: public; Owner: -
|
|
1158 | 1159 |
-- |
1159 | 1160 |
|
1160 |
COMMENT ON COLUMN taxonoccurrence.isnative IS 'native or exotic';
|
|
1161 |
COMMENT ON COLUMN taxonconcept.author IS 'The author of the taxonomic name.
|
|
1161 | 1162 |
|
1163 |
Equivalent to Darwin Core''s scientificNameAuthorship.'; |
|
1162 | 1164 |
|
1165 |
|
|
1163 | 1166 |
-- |
1164 |
-- Name: taxonpath; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1167 |
-- Name: COLUMN taxonconcept.taxonomicnamewithauthor; Type: COMMENT; Schema: public; Owner: -
|
|
1165 | 1168 |
-- |
1166 | 1169 |
|
1167 |
CREATE TABLE taxonpath ( |
|
1168 |
taxonpath_id integer NOT NULL, |
|
1169 |
datasource_id integer NOT NULL, |
|
1170 |
identifyingtaxonomicname text, |
|
1171 |
canon_taxonpath_id integer, |
|
1172 |
taxon_id integer, |
|
1173 |
taxonomicname text, |
|
1174 |
author text, |
|
1175 |
taxonomicnamewithauthor text, |
|
1176 |
domain text, |
|
1177 |
kingdom text, |
|
1178 |
phylum text, |
|
1179 |
class text, |
|
1180 |
"order" text, |
|
1181 |
family text, |
|
1182 |
genus text, |
|
1183 |
species text, |
|
1184 |
subspecies text, |
|
1185 |
variety text, |
|
1186 |
forma text, |
|
1187 |
cultivar text, |
|
1188 |
morphospecies text, |
|
1189 |
otherranks rankedtaxonname[], |
|
1190 |
scope_id integer, |
|
1191 |
accessioncode text, |
|
1192 |
CONSTRAINT taxonpath_required_key CHECK (((((((identifyingtaxonomicname IS NOT NULL) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR (family IS NOT NULL)) OR (genus IS NOT NULL)) OR (otherranks IS NOT NULL))) |
|
1193 |
); |
|
1170 |
COMMENT ON COLUMN taxonconcept.taxonomicnamewithauthor IS 'The concatenated taxonomic name which uniquely identifies this taxon, plus the author of that name. |
|
1194 | 1171 |
|
1172 |
Equivalent to Darwin Core''s scientificName + scientificNameAuthorship. |
|
1173 |
Equivalent to "Name sec. x".'; |
|
1195 | 1174 |
|
1175 |
|
|
1196 | 1176 |
-- |
1197 |
-- Name: TABLE taxonpath; Type: COMMENT; Schema: public; Owner: -
|
|
1177 |
-- Name: COLUMN taxonconcept.domain; Type: COMMENT; Schema: public; Owner: -
|
|
1198 | 1178 |
-- |
1199 | 1179 |
|
1200 |
COMMENT ON TABLE taxonpath IS 'The full path to a taxon, including all components of the taxonomic name. Can be either verbatim or accepted. For accepted names, points to the identified taxon in the tree of life.
|
|
1180 |
COMMENT ON COLUMN taxonconcept.domain IS 'The domain portion of the taxonomic name.';
|
|
1201 | 1181 |
|
1202 |
To include a taxon name at a rank with no explicit column, add it to the otherranks array.'; |
|
1203 | 1182 |
|
1204 |
|
|
1205 | 1183 |
-- |
1206 |
-- Name: COLUMN taxonpath.identifyingtaxonomicname; Type: COMMENT; Schema: public; Owner: -
|
|
1184 |
-- Name: COLUMN taxonconcept.kingdom; Type: COMMENT; Schema: public; Owner: -
|
|
1207 | 1185 |
-- |
1208 | 1186 |
|
1209 |
COMMENT ON COLUMN taxonpath.identifyingtaxonomicname IS 'The taxonomic name that uniquely identifies this taxonpath. If set, the other fields will not be used in duplicate elimination.';
|
|
1187 |
COMMENT ON COLUMN taxonconcept.kingdom IS 'The kingdom portion of the taxonomic name.';
|
|
1210 | 1188 |
|
1211 | 1189 |
|
1212 | 1190 |
-- |
1213 |
-- Name: COLUMN taxonpath.canon_taxonpath_id; Type: COMMENT; Schema: public; Owner: -
|
|
1191 |
-- Name: COLUMN taxonconcept.phylum; Type: COMMENT; Schema: public; Owner: -
|
|
1214 | 1192 |
-- |
1215 | 1193 |
|
1216 |
COMMENT ON COLUMN taxonpath.canon_taxonpath_id IS 'The taxonpath containing the accepted name of this verbatim taxonomic name. taxonpaths should be linked in a three-level hierarchy of datasource name -> concatenated name -> accepted name.
|
|
1194 |
COMMENT ON COLUMN taxonconcept.phylum IS 'The phylum portion of the taxonomic name.';
|
|
1217 | 1195 |
|
1218 |
An accepted name should point to itself in this field. This will happen automatically by setting it to the special value 0.'; |
|
1219 | 1196 |
|
1220 |
|
|
1221 | 1197 |
-- |
1222 |
-- Name: COLUMN taxonpath.taxon_id; Type: COMMENT; Schema: public; Owner: -
|
|
1198 |
-- Name: COLUMN taxonconcept.class; Type: COMMENT; Schema: public; Owner: -
|
|
1223 | 1199 |
-- |
1224 | 1200 |
|
1225 |
COMMENT ON COLUMN taxonpath.taxon_id IS 'The corresponding taxon in the tree of life. Only used for parsed names.';
|
|
1201 |
COMMENT ON COLUMN taxonconcept.class IS 'The class portion of the taxonomic name.';
|
|
1226 | 1202 |
|
1227 | 1203 |
|
1228 | 1204 |
-- |
1229 |
-- Name: COLUMN taxonpath.taxonomicname; Type: COMMENT; Schema: public; Owner: -
|
|
1205 |
-- Name: COLUMN taxonconcept."order"; Type: COMMENT; Schema: public; Owner: -
|
|
1230 | 1206 |
-- |
1231 | 1207 |
|
1232 |
COMMENT ON COLUMN taxonpath.taxonomicname IS 'The concatenated taxonomic name which uniquely identifies this taxon. Does not include the author of the name.
|
|
1208 |
COMMENT ON COLUMN taxonconcept."order" IS 'The order portion of the taxonomic name.';
|
|
1233 | 1209 |
|
1234 |
Equivalent to Darwin Core''s scientificName.'; |
|
1235 | 1210 |
|
1236 |
|
|
1237 | 1211 |
-- |
1238 |
-- Name: COLUMN taxonpath.author; Type: COMMENT; Schema: public; Owner: -
|
|
1212 |
-- Name: COLUMN taxonconcept.family; Type: COMMENT; Schema: public; Owner: -
|
|
1239 | 1213 |
-- |
1240 | 1214 |
|
1241 |
COMMENT ON COLUMN taxonpath.author IS 'The author of the taxonomic name.
|
|
1215 |
COMMENT ON COLUMN taxonconcept.family IS 'The family portion of the taxonomic name.';
|
|
1242 | 1216 |
|
1243 |
Equivalent to Darwin Core''s scientificNameAuthorship.'; |
|
1244 | 1217 |
|
1245 |
|
|
1246 | 1218 |
-- |
1247 |
-- Name: COLUMN taxonpath.taxonomicnamewithauthor; Type: COMMENT; Schema: public; Owner: -
|
|
1219 |
-- Name: COLUMN taxonconcept.genus; Type: COMMENT; Schema: public; Owner: -
|
|
1248 | 1220 |
-- |
1249 | 1221 |
|
1250 |
COMMENT ON COLUMN taxonpath.taxonomicnamewithauthor IS 'The concatenated taxonomic name which uniquely identifies this taxon, plus the author of that name.
|
|
1222 |
COMMENT ON COLUMN taxonconcept.genus IS 'The genus portion of the taxonomic name.';
|
|
1251 | 1223 |
|
1252 |
Equivalent to Darwin Core''s scientificName + scientificNameAuthorship. |
|
1253 |
Equivalent to "Name sec. x".'; |
|
1254 | 1224 |
|
1255 |
|
|
1256 | 1225 |
-- |
1257 |
-- Name: COLUMN taxonpath.domain; Type: COMMENT; Schema: public; Owner: -
|
|
1226 |
-- Name: COLUMN taxonconcept.species; Type: COMMENT; Schema: public; Owner: -
|
|
1258 | 1227 |
-- |
1259 | 1228 |
|
1260 |
COMMENT ON COLUMN taxonpath.domain IS 'The domain portion of the taxonomic name.';
|
|
1229 |
COMMENT ON COLUMN taxonconcept.species IS 'The species portion of the taxonomic name.';
|
|
1261 | 1230 |
|
1262 | 1231 |
|
1263 | 1232 |
-- |
1264 |
-- Name: COLUMN taxonpath.kingdom; Type: COMMENT; Schema: public; Owner: -
|
|
1233 |
-- Name: COLUMN taxonconcept.subspecies; Type: COMMENT; Schema: public; Owner: -
|
|
1265 | 1234 |
-- |
1266 | 1235 |
|
1267 |
COMMENT ON COLUMN taxonpath.kingdom IS 'The kingdom portion of the taxonomic name.';
|
|
1236 |
COMMENT ON COLUMN taxonconcept.subspecies IS 'The subspecies portion of the taxonomic name.';
|
|
1268 | 1237 |
|
1269 | 1238 |
|
1270 | 1239 |
-- |
1271 |
-- Name: COLUMN taxonpath.phylum; Type: COMMENT; Schema: public; Owner: -
|
|
1240 |
-- Name: COLUMN taxonconcept.variety; Type: COMMENT; Schema: public; Owner: -
|
|
1272 | 1241 |
-- |
1273 | 1242 |
|
1274 |
COMMENT ON COLUMN taxonpath.phylum IS 'The phylum portion of the taxonomic name.';
|
|
1243 |
COMMENT ON COLUMN taxonconcept.variety IS 'The variety portion of the taxonomic name.';
|
|
1275 | 1244 |
|
1276 | 1245 |
|
1277 | 1246 |
-- |
1278 |
-- Name: COLUMN taxonpath.class; Type: COMMENT; Schema: public; Owner: -
|
|
1247 |
-- Name: COLUMN taxonconcept.forma; Type: COMMENT; Schema: public; Owner: -
|
|
1279 | 1248 |
-- |
1280 | 1249 |
|
1281 |
COMMENT ON COLUMN taxonpath.class IS 'The class portion of the taxonomic name.';
|
|
1250 |
COMMENT ON COLUMN taxonconcept.forma IS 'The forma portion of the taxonomic name.';
|
|
1282 | 1251 |
|
1283 | 1252 |
|
1284 | 1253 |
-- |
1285 |
-- Name: COLUMN taxonpath."order"; Type: COMMENT; Schema: public; Owner: -
|
|
1254 |
-- Name: COLUMN taxonconcept.cultivar; Type: COMMENT; Schema: public; Owner: -
|
|
1286 | 1255 |
-- |
1287 | 1256 |
|
1288 |
COMMENT ON COLUMN taxonpath."order" IS 'The order portion of the taxonomic name.';
|
|
1257 |
COMMENT ON COLUMN taxonconcept.cultivar IS 'The cultivar portion of the taxonomic name.';
|
|
1289 | 1258 |
|
1290 | 1259 |
|
1291 | 1260 |
-- |
1292 |
-- Name: COLUMN taxonpath.family; Type: COMMENT; Schema: public; Owner: -
|
|
1261 |
-- Name: COLUMN taxonconcept.morphospecies; Type: COMMENT; Schema: public; Owner: -
|
|
1293 | 1262 |
-- |
1294 | 1263 |
|
1295 |
COMMENT ON COLUMN taxonpath.family IS 'The family portion of the taxonomic name.';
|
|
1264 |
COMMENT ON COLUMN taxonconcept.morphospecies IS 'The morphospecies portion of the taxonomic name.';
|
|
1296 | 1265 |
|
1297 | 1266 |
|
1298 | 1267 |
-- |
1299 |
-- Name: COLUMN taxonpath.genus; Type: COMMENT; Schema: public; Owner: -
|
|
1268 |
-- Name: COLUMN taxonconcept.otherranks; Type: COMMENT; Schema: public; Owner: -
|
|
1300 | 1269 |
-- |
1301 | 1270 |
|
1302 |
COMMENT ON COLUMN taxonpath.genus IS 'The genus portion of the taxonomic name.';
|
|
1271 |
COMMENT ON COLUMN taxonconcept.otherranks IS 'Additional ranks which do not have a named column. Put ranks in path order, so that lower-level taxa come after higher-level taxa.';
|
|
1303 | 1272 |
|
1304 | 1273 |
|
1305 | 1274 |
-- |
1306 |
-- Name: COLUMN taxonpath.species; Type: COMMENT; Schema: public; Owner: -
|
|
1275 |
-- Name: COLUMN taxonconcept.scope_id; Type: COMMENT; Schema: public; Owner: -
|
|
1307 | 1276 |
-- |
1308 | 1277 |
|
1309 |
COMMENT ON COLUMN taxonpath.species IS 'The species portion of the taxonomic name.';
|
|
1278 |
COMMENT ON COLUMN taxonconcept.scope_id IS 'The morphospecies scope.';
|
|
1310 | 1279 |
|
1311 | 1280 |
|
1312 | 1281 |
-- |
1313 |
-- Name: COLUMN taxonpath.subspecies; Type: COMMENT; Schema: public; Owner: -
|
|
1282 |
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1314 | 1283 |
-- |
1315 | 1284 |
|
1316 |
COMMENT ON COLUMN taxonpath.subspecies IS 'The subspecies portion of the taxonomic name.'; |
|
1285 |
CREATE TABLE taxondetermination ( |
|
1286 |
taxondetermination_id integer NOT NULL, |
|
1287 |
taxonoccurrence_id integer NOT NULL, |
|
1288 |
taxonconcept_id integer NOT NULL, |
|
1289 |
party_id integer, |
|
1290 |
role role DEFAULT 'unknown'::role NOT NULL, |
|
1291 |
determinationtype text, |
|
1292 |
reference_id integer, |
|
1293 |
isoriginal boolean DEFAULT false NOT NULL, |
|
1294 |
iscurrent boolean DEFAULT false NOT NULL, |
|
1295 |
taxonfit text, |
|
1296 |
taxonconfidence text, |
|
1297 |
grouptype text, |
|
1298 |
notes text, |
|
1299 |
notespublic boolean, |
|
1300 |
notesmgt boolean, |
|
1301 |
revisions boolean, |
|
1302 |
determinationdate timestamp with time zone, |
|
1303 |
accessioncode text |
|
1304 |
); |
|
1317 | 1305 |
|
1318 | 1306 |
|
1319 | 1307 |
-- |
1320 |
-- Name: COLUMN taxonpath.variety; Type: COMMENT; Schema: public; Owner: -
|
|
1308 |
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
|
|
1321 | 1309 |
-- |
1322 | 1310 |
|
1323 |
COMMENT ON COLUMN taxonpath.variety IS 'The variety portion of the taxonomic name.';
|
|
1311 |
COMMENT ON TABLE taxondetermination IS 'Equivalent to VegBank''s taxoninterpretation table.';
|
|
1324 | 1312 |
|
1325 | 1313 |
|
1326 | 1314 |
-- |
1327 |
-- Name: COLUMN taxonpath.forma; Type: COMMENT; Schema: public; Owner: -
|
|
1315 |
-- Name: taxonoccurrence; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
1328 | 1316 |
-- |
1329 | 1317 |
|
1330 |
COMMENT ON COLUMN taxonpath.forma IS 'The forma portion of the taxonomic name.'; |
|
1318 |
CREATE TABLE taxonoccurrence ( |
|
1319 |
taxonoccurrence_id integer NOT NULL, |
|
1320 |
datasource_id integer NOT NULL, |
|
1321 |
sourceaccessioncode text, |
|
1322 |
locationevent_id integer, |
|
1323 |
authortaxoncode text, |
|
1324 |
verbatimcollectorname text, |
|
1325 |
growthform growthform, |
|
1326 |
iscultivated boolean, |
|
1327 |
cultivatedbasis text, |
|
1328 |
isnative boolean, |
|
1329 |
accessioncode text |
|
1330 |
); |
|
1331 | 1331 |
|
1332 | 1332 |
|
1333 | 1333 |
-- |
1334 |
-- Name: COLUMN taxonpath.cultivar; Type: COMMENT; Schema: public; Owner: -
|
|
1334 |
-- Name: TABLE taxonoccurrence; Type: COMMENT; Schema: public; Owner: -
|
|
1335 | 1335 |
-- |
1336 | 1336 |
|
1337 |
COMMENT ON COLUMN taxonpath.cultivar IS 'The cultivar portion of the taxonomic name.';
|
|
1337 |
COMMENT ON TABLE taxonoccurrence IS 'Equivalent to VegBank''s taxonobservation table.';
|
|
1338 | 1338 |
|
1339 | 1339 |
|
1340 | 1340 |
-- |
1341 |
-- Name: COLUMN taxonpath.morphospecies; Type: COMMENT; Schema: public; Owner: -
|
|
1341 |
-- Name: COLUMN taxonoccurrence.iscultivated; Type: COMMENT; Schema: public; Owner: -
|
|
1342 | 1342 |
-- |
1343 | 1343 |
|
1344 |
COMMENT ON COLUMN taxonpath.morphospecies IS 'The morphospecies portion of the taxonomic name.';
|
|
1344 |
COMMENT ON COLUMN taxonoccurrence.iscultivated IS 'cultivated or wild';
|
|
1345 | 1345 |
|
1346 | 1346 |
|
1347 | 1347 |
-- |
1348 |
-- Name: COLUMN taxonpath.otherranks; Type: COMMENT; Schema: public; Owner: -
|
|
1348 |
-- Name: COLUMN taxonoccurrence.cultivatedbasis; Type: COMMENT; Schema: public; Owner: -
|
|
1349 | 1349 |
-- |
1350 | 1350 |
|
1351 |
COMMENT ON COLUMN taxonpath.otherranks IS 'Additional ranks which do not have a named column. Put ranks in path order, so that lower-level taxa come after higher-level taxa.';
|
|
1351 |
COMMENT ON COLUMN taxonoccurrence.cultivatedbasis IS 'The reason why a taxonoccurrence was marked as cultivated (or not).';
|
|
1352 | 1352 |
|
1353 | 1353 |
|
1354 | 1354 |
-- |
1355 |
-- Name: COLUMN taxonpath.scope_id; Type: COMMENT; Schema: public; Owner: -
|
|
1355 |
-- Name: COLUMN taxonoccurrence.isnative; Type: COMMENT; Schema: public; Owner: -
|
|
1356 | 1356 |
-- |
1357 | 1357 |
|
1358 |
COMMENT ON COLUMN taxonpath.scope_id IS 'The morphospecies scope.';
|
|
1358 |
COMMENT ON COLUMN taxonoccurrence.isnative IS 'native or exotic';
|
|
1359 | 1359 |
|
1360 | 1360 |
|
1361 | 1361 |
-- |
... | ... | |
1363 | 1363 |
-- |
1364 | 1364 |
|
1365 | 1365 |
CREATE VIEW analytical_db_view AS |
1366 |
SELECT datasource.organizationname AS "dataSourceName", taxonpath.family, taxonpath.genus, taxonpath.species, COALESCE(taxonpath.taxonomicnamewithauthor, taxonpath.taxonomicname) AS taxon, taxonpath.author AS "taxonAuthor", taxonpath.variety AS "taxonMorphospecies", placepath.country, placepath.stateprovince AS "stateProvince", placepath.county AS "countyParish", taxonoccurrence.verbatimcollectorname AS collector, plantobservation.collectionnumber AS "collectionNumber", array_to_string(ARRAY[identifiedby.givenname, identifiedby.middlename, identifiedby.surname], ' '::text) AS "identifiedBy", aggregateoccurrence.collectiondate AS "observationDate", location.authorlocationcode AS "plotCode", functions._m2_to_ha(location.area_m2) AS "plotAreaHa", method.name AS "plotMethod", locationcoords.latitude_deg AS latitude, locationcoords.longitude_deg AS longitude, location.elevation_m, taxonoccurrence.iscultivated AS "isCultivated", taxonoccurrence.cultivatedbasis AS "isCultivatedReason", functions._fraction_to_percent(aggregateoccurrence.cover_fraction) AS "pctCover" FROM (((((((((((((location JOIN party datasource ON (((datasource.party_id = location.datasource_id) AND (datasource.organizationname IS NOT NULL)))) LEFT JOIN locationcoords USING (location_id)) LEFT JOIN locationplace USING (location_id)) LEFT JOIN placepath USING (placepath_id)) JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) JOIN taxonoccurrence USING (locationevent_id)) JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) JOIN taxonpath USING (taxonpath_id)) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id));
|
|
1366 |
SELECT datasource.organizationname AS "dataSourceName", taxonconcept.family, taxonconcept.genus, taxonconcept.species, COALESCE(taxonconcept.taxonomicnamewithauthor, taxonconcept.taxonomicname) AS taxon, taxonconcept.author AS "taxonAuthor", taxonconcept.variety AS "taxonMorphospecies", placepath.country, placepath.stateprovince AS "stateProvince", placepath.county AS "countyParish", taxonoccurrence.verbatimcollectorname AS collector, plantobservation.collectionnumber AS "collectionNumber", array_to_string(ARRAY[identifiedby.givenname, identifiedby.middlename, identifiedby.surname], ' '::text) AS "identifiedBy", aggregateoccurrence.collectiondate AS "observationDate", location.authorlocationcode AS "plotCode", functions._m2_to_ha(location.area_m2) AS "plotAreaHa", method.name AS "plotMethod", locationcoords.latitude_deg AS latitude, locationcoords.longitude_deg AS longitude, location.elevation_m, taxonoccurrence.iscultivated AS "isCultivated", taxonoccurrence.cultivatedbasis AS "isCultivatedReason", functions._fraction_to_percent(aggregateoccurrence.cover_fraction) AS "pctCover" FROM (((((((((((((location JOIN party datasource ON (((datasource.party_id = location.datasource_id) AND (datasource.organizationname IS NOT NULL)))) LEFT JOIN locationcoords USING (location_id)) LEFT JOIN locationplace USING (location_id)) LEFT JOIN placepath USING (placepath_id)) JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) JOIN taxonoccurrence USING (locationevent_id)) JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) JOIN taxonconcept USING (taxonconcept_id)) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id));
|
|
1367 | 1367 |
|
1368 | 1368 |
|
1369 | 1369 |
-- |
... | ... | |
2030 | 2030 |
CREATE TABLE methodtaxonclass ( |
2031 | 2031 |
methodtaxonclass_id integer NOT NULL, |
2032 | 2032 |
method_id integer NOT NULL, |
2033 |
taxonpath_id integer,
|
|
2033 |
taxonconcept_id integer,
|
|
2034 | 2034 |
included boolean NOT NULL, |
2035 | 2035 |
submethod_id integer, |
2036 | 2036 |
taxonclass taxonclass, |
2037 |
CONSTRAINT methodtaxonclass_key_required CHECK (((taxonpath_id IS NOT NULL) OR (taxonclass IS NOT NULL)))
|
|
2037 |
CONSTRAINT methodtaxonclass_key_required CHECK (((taxonconcept_id IS NOT NULL) OR (taxonclass IS NOT NULL)))
|
|
2038 | 2038 |
); |
2039 | 2039 |
|
2040 | 2040 |
|
... | ... | |
2334 | 2334 |
CREATE TABLE plantcorrelation ( |
2335 | 2335 |
plantcorrelation_id integer NOT NULL, |
2336 | 2336 |
plantstatus_id integer NOT NULL, |
2337 |
taxonpath_id integer NOT NULL,
|
|
2337 |
taxonconcept_id integer NOT NULL,
|
|
2338 | 2338 |
plantconvergence text NOT NULL, |
2339 | 2339 |
correlationstart timestamp with time zone NOT NULL, |
2340 | 2340 |
correlationstop timestamp with time zone |
... | ... | |
2415 | 2415 |
|
2416 | 2416 |
CREATE TABLE plantstatus ( |
2417 | 2417 |
plantstatus_id integer NOT NULL, |
2418 |
taxonpath_id integer NOT NULL,
|
|
2418 |
taxonconcept_id integer NOT NULL,
|
|
2419 | 2419 |
party_id integer, |
2420 |
taxonpathstatus text DEFAULT 'undetermined'::text NOT NULL,
|
|
2420 |
taxonconceptstatus text DEFAULT 'undetermined'::text NOT NULL,
|
|
2421 | 2421 |
reference_id integer, |
2422 | 2422 |
plantpartycomments text, |
2423 | 2423 |
startdate timestamp with time zone, |
... | ... | |
2452 | 2452 |
CREATE TABLE plantusage ( |
2453 | 2453 |
plantusage_id integer NOT NULL, |
2454 | 2454 |
taxon_id integer NOT NULL, |
2455 |
taxonpath_id integer,
|
|
2455 |
taxonconcept_id integer,
|
|
2456 | 2456 |
taxonstatus text, |
2457 | 2457 |
taxon text, |
2458 | 2458 |
classsystem text, |
... | ... | |
3120 | 3120 |
CREATE TABLE taxonalt ( |
3121 | 3121 |
taxonalt_id integer NOT NULL, |
3122 | 3122 |
taxondetermination_id integer NOT NULL, |
3123 |
taxonpath_id integer NOT NULL,
|
|
3123 |
taxonconcept_id integer NOT NULL,
|
|
3124 | 3124 |
taxonaltfit text, |
3125 | 3125 |
taxonaltconfidence text, |
3126 | 3126 |
taxonaltnotes text |
... | ... | |
3147 | 3147 |
|
3148 | 3148 |
|
3149 | 3149 |
-- |
3150 |
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3150 |
-- Name: taxonconcept_taxonconcept_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3151 | 3151 |
-- |
3152 | 3152 |
|
3153 |
CREATE SEQUENCE taxondetermination_taxondetermination_id_seq
|
|
3153 |
CREATE SEQUENCE taxonconcept_taxonconcept_id_seq
|
|
3154 | 3154 |
START WITH 1 |
3155 | 3155 |
INCREMENT BY 1 |
3156 | 3156 |
NO MINVALUE |
... | ... | |
3159 | 3159 |
|
3160 | 3160 |
|
3161 | 3161 |
-- |
3162 |
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3162 |
-- Name: taxonconcept_taxonconcept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3163 | 3163 |
-- |
3164 | 3164 |
|
3165 |
ALTER SEQUENCE taxondetermination_taxondetermination_id_seq OWNED BY taxondetermination.taxondetermination_id;
|
|
3165 |
ALTER SEQUENCE taxonconcept_taxonconcept_id_seq OWNED BY taxonconcept.taxonconcept_id;
|
|
3166 | 3166 |
|
3167 | 3167 |
|
3168 | 3168 |
-- |
3169 |
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3169 |
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3170 | 3170 |
-- |
3171 | 3171 |
|
3172 |
CREATE SEQUENCE taxonoccurrence_taxonoccurrence_id_seq
|
|
3172 |
CREATE SEQUENCE taxondetermination_taxondetermination_id_seq
|
|
3173 | 3173 |
START WITH 1 |
3174 | 3174 |
INCREMENT BY 1 |
3175 | 3175 |
NO MINVALUE |
... | ... | |
3178 | 3178 |
|
3179 | 3179 |
|
3180 | 3180 |
-- |
3181 |
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3181 |
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3182 | 3182 |
-- |
3183 | 3183 |
|
3184 |
ALTER SEQUENCE taxonoccurrence_taxonoccurrence_id_seq OWNED BY taxonoccurrence.taxonoccurrence_id;
|
|
3184 |
ALTER SEQUENCE taxondetermination_taxondetermination_id_seq OWNED BY taxondetermination.taxondetermination_id;
|
|
3185 | 3185 |
|
3186 | 3186 |
|
3187 | 3187 |
-- |
3188 |
-- Name: taxonpath_taxonpath_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3188 |
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3189 | 3189 |
-- |
3190 | 3190 |
|
3191 |
CREATE SEQUENCE taxonpath_taxonpath_id_seq
|
|
3191 |
CREATE SEQUENCE taxonoccurrence_taxonoccurrence_id_seq
|
|
3192 | 3192 |
START WITH 1 |
3193 | 3193 |
INCREMENT BY 1 |
3194 | 3194 |
NO MINVALUE |
... | ... | |
3197 | 3197 |
|
3198 | 3198 |
|
3199 | 3199 |
-- |
3200 |
-- Name: taxonpath_taxonpath_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3200 |
-- Name: taxonoccurrence_taxonoccurrence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3201 | 3201 |
-- |
3202 | 3202 |
|
3203 |
ALTER SEQUENCE taxonpath_taxonpath_id_seq OWNED BY taxonpath.taxonpath_id;
|
|
3203 |
ALTER SEQUENCE taxonoccurrence_taxonoccurrence_id_seq OWNED BY taxonoccurrence.taxonoccurrence_id;
|
|
3204 | 3204 |
|
3205 | 3205 |
|
3206 | 3206 |
-- |
... | ... | |
3741 | 3741 |
|
3742 | 3742 |
|
3743 | 3743 |
-- |
3744 |
-- Name: taxondetermination_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3744 |
-- Name: taxonconcept_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3745 | 3745 |
-- |
3746 | 3746 |
|
3747 |
ALTER TABLE taxondetermination ALTER COLUMN taxondetermination_id SET DEFAULT nextval('taxondetermination_taxondetermination_id_seq'::regclass);
|
|
3747 |
ALTER TABLE taxonconcept ALTER COLUMN taxonconcept_id SET DEFAULT nextval('taxonconcept_taxonconcept_id_seq'::regclass);
|
|
3748 | 3748 |
|
3749 | 3749 |
|
3750 | 3750 |
-- |
3751 |
-- Name: taxonoccurrence_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3751 |
-- Name: taxondetermination_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3752 | 3752 |
-- |
3753 | 3753 |
|
3754 |
ALTER TABLE taxonoccurrence ALTER COLUMN taxonoccurrence_id SET DEFAULT nextval('taxonoccurrence_taxonoccurrence_id_seq'::regclass);
|
|
3754 |
ALTER TABLE taxondetermination ALTER COLUMN taxondetermination_id SET DEFAULT nextval('taxondetermination_taxondetermination_id_seq'::regclass);
|
|
3755 | 3755 |
|
3756 | 3756 |
|
3757 | 3757 |
-- |
3758 |
-- Name: taxonpath_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3758 |
-- Name: taxonoccurrence_id; Type: DEFAULT; Schema: public; Owner: -
|
|
3759 | 3759 |
-- |
3760 | 3760 |
|
3761 |
ALTER TABLE taxonpath ALTER COLUMN taxonpath_id SET DEFAULT nextval('taxonpath_taxonpath_id_seq'::regclass);
|
|
3761 |
ALTER TABLE taxonoccurrence ALTER COLUMN taxonoccurrence_id SET DEFAULT nextval('taxonoccurrence_taxonoccurrence_id_seq'::regclass);
|
|
3762 | 3762 |
|
3763 | 3763 |
|
3764 | 3764 |
-- |
... | ... | |
4029 | 4029 |
|
4030 | 4030 |
|
4031 | 4031 |
-- |
4032 |
-- Name: methodtaxonclass_unique_taxonpath_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4032 |
-- Name: methodtaxonclass_unique_taxonconcept_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4033 | 4033 |
-- |
4034 | 4034 |
|
4035 | 4035 |
ALTER TABLE ONLY methodtaxonclass |
4036 |
ADD CONSTRAINT methodtaxonclass_unique_taxonpath_id UNIQUE (method_id, taxonpath_id);
|
|
4036 |
ADD CONSTRAINT methodtaxonclass_unique_taxonconcept_id UNIQUE (method_id, taxonconcept_id);
|
|
4037 | 4037 |
|
4038 | 4038 |
|
4039 | 4039 |
-- |
... | ... | |
4145 | 4145 |
-- |
4146 | 4146 |
|
4147 | 4147 |
ALTER TABLE ONLY plantstatus |
4148 |
ADD CONSTRAINT plantstatus_unique UNIQUE (taxonpath_id, party_id);
|
|
4148 |
ADD CONSTRAINT plantstatus_unique UNIQUE (taxonconcept_id, party_id);
|
|
4149 | 4149 |
|
4150 | 4150 |
|
4151 | 4151 |
-- |
... | ... | |
4309 | 4309 |
|
4310 | 4310 |
|
4311 | 4311 |
-- |
4312 |
-- Name: taxonconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4313 |
-- |
|
4314 |
|
|
4315 |
ALTER TABLE ONLY taxonconcept |
|
4316 |
ADD CONSTRAINT taxonconcept_pkey PRIMARY KEY (taxonconcept_id); |
|
4317 |
|
|
4318 |
|
|
4319 |
-- |
|
4312 | 4320 |
-- Name: taxondetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4313 | 4321 |
-- |
4314 | 4322 |
|
... | ... | |
4325 | 4333 |
|
4326 | 4334 |
|
4327 | 4335 |
-- |
4328 |
-- Name: taxonpath_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4329 |
-- |
|
4330 |
|
|
4331 |
ALTER TABLE ONLY taxonpath |
|
4332 |
ADD CONSTRAINT taxonpath_pkey PRIMARY KEY (taxonpath_id); |
|
4333 |
|
|
4334 |
|
|
4335 |
-- |
|
4336 | 4336 |
-- Name: taxonscope_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4337 | 4337 |
-- |
4338 | 4338 |
|
... | ... | |
4739 | 4739 |
|
4740 | 4740 |
|
4741 | 4741 |
-- |
4742 |
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4742 |
-- Name: taxonconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4743 | 4743 |
-- |
4744 | 4744 |
|
4745 |
CREATE UNIQUE INDEX taxondetermination_accessioncode_index ON taxondetermination USING btree (accessioncode);
|
|
4745 |
CREATE UNIQUE INDEX taxonconcept_accessioncode_index ON taxonconcept USING btree (accessioncode);
|
|
4746 | 4746 |
|
4747 | 4747 |
|
4748 | 4748 |
-- |
4749 |
-- Name: taxondetermination_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4749 |
-- Name: taxonconcept_unique_within_datasource_by_identifying_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4750 | 4750 |
-- |
4751 | 4751 |
|
4752 |
CREATE UNIQUE INDEX taxondetermination_unique ON taxondetermination USING btree (taxonoccurrence_id, isoriginal, role, (COALESCE(party_id, 2147483647)), taxonpath_id);
|
|
4752 |
CREATE UNIQUE INDEX taxonconcept_unique_within_datasource_by_identifying_name ON taxonconcept USING btree (datasource_id, (COALESCE(identifyingtaxonomicname, '\\N'::text))) WHERE (identifyingtaxonomicname IS NOT NULL);
|
|
4753 | 4753 |
|
4754 | 4754 |
|
4755 | 4755 |
-- |
4756 |
-- Name: taxonoccurrence_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4756 |
-- Name: taxonconcept_unique_within_datasource_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4757 | 4757 |
-- |
4758 | 4758 |
|
4759 |
CREATE UNIQUE INDEX taxonoccurrence_accessioncode_index ON taxonoccurrence USING btree (accessioncode);
|
|
4759 |
CREATE UNIQUE INDEX taxonconcept_unique_within_datasource_by_name ON taxonconcept USING btree (datasource_id, (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)), (COALESCE(otherranks, ARRAY[]::rankedtaxonname[])), (COALESCE(scope_id, 2147483647))) WHERE (identifyingtaxonomicname IS NULL);
|
|
4760 | 4760 |
|
4761 | 4761 |
|
4762 | 4762 |
-- |
4763 |
-- Name: taxonoccurrence_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4763 |
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4764 | 4764 |
-- |
4765 | 4765 |
|
4766 |
CREATE INDEX taxonoccurrence_locationevent ON taxonoccurrence USING btree (locationevent_id);
|
|
4766 |
CREATE UNIQUE INDEX taxondetermination_accessioncode_index ON taxondetermination USING btree (accessioncode);
|
|
4767 | 4767 |
|
4768 | 4768 |
|
4769 | 4769 |
-- |
4770 |
-- Name: taxonoccurrence_unique_within_datasource; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4770 |
-- Name: taxondetermination_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4771 | 4771 |
-- |
4772 | 4772 |
|
4773 |
CREATE UNIQUE INDEX taxonoccurrence_unique_within_datasource ON taxonoccurrence USING btree (datasource_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
|
|
4773 |
CREATE UNIQUE INDEX taxondetermination_unique ON taxondetermination USING btree (taxonoccurrence_id, isoriginal, role, (COALESCE(party_id, 2147483647)), taxonconcept_id);
|
|
4774 | 4774 |
|
4775 | 4775 |
|
4776 | 4776 |
-- |
4777 |
-- Name: taxonoccurrence_unique_within_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4777 |
-- Name: taxonoccurrence_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4778 | 4778 |
-- |
4779 | 4779 |
|
4780 |
CREATE UNIQUE INDEX taxonoccurrence_unique_within_locationevent ON taxonoccurrence USING btree ((COALESCE(locationevent_id, 2147483647)), (COALESCE(authortaxoncode, '\\N'::text))) WHERE (sourceaccessioncode IS NULL);
|
|
4780 |
CREATE UNIQUE INDEX taxonoccurrence_accessioncode_index ON taxonoccurrence USING btree (accessioncode);
|
|
4781 | 4781 |
|
4782 | 4782 |
|
4783 | 4783 |
-- |
4784 |
-- Name: taxonpath_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4784 |
-- Name: taxonoccurrence_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4785 | 4785 |
-- |
4786 | 4786 |
|
4787 |
CREATE UNIQUE INDEX taxonpath_accessioncode_index ON taxonpath USING btree (accessioncode);
|
|
4787 |
CREATE INDEX taxonoccurrence_locationevent ON taxonoccurrence USING btree (locationevent_id);
|
|
4788 | 4788 |
|
4789 | 4789 |
|
4790 | 4790 |
-- |
4791 |
-- Name: taxonpath_unique_within_datasource_by_identifying_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4791 |
-- Name: taxonoccurrence_unique_within_datasource; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4792 | 4792 |
-- |
4793 | 4793 |
|
4794 |
CREATE UNIQUE INDEX taxonpath_unique_within_datasource_by_identifying_name ON taxonpath USING btree (datasource_id, (COALESCE(identifyingtaxonomicname, '\\N'::text))) WHERE (identifyingtaxonomicname IS NOT NULL);
|
|
4794 |
CREATE UNIQUE INDEX taxonoccurrence_unique_within_datasource ON taxonoccurrence USING btree (datasource_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
|
|
4795 | 4795 |
|
4796 | 4796 |
|
4797 | 4797 |
-- |
4798 |
-- Name: taxonpath_unique_within_datasource_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4798 |
-- Name: taxonoccurrence_unique_within_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4799 | 4799 |
-- |
4800 | 4800 |
|
4801 |
CREATE UNIQUE INDEX taxonpath_unique_within_datasource_by_name ON taxonpath USING btree (datasource_id, (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)), (COALESCE(otherranks, ARRAY[]::rankedtaxonname[])), (COALESCE(scope_id, 2147483647))) WHERE (identifyingtaxonomicname IS NULL);
|
|
4801 |
CREATE UNIQUE INDEX taxonoccurrence_unique_within_locationevent ON taxonoccurrence USING btree ((COALESCE(locationevent_id, 2147483647)), (COALESCE(authortaxoncode, '\\N'::text))) WHERE (sourceaccessioncode IS NULL);
|
|
4802 | 4802 |
|
4803 | 4803 |
|
4804 | 4804 |
-- |
... | ... | |
4844 | 4844 |
|
4845 | 4845 |
|
4846 | 4846 |
-- |
4847 |
-- Name: taxonpath_canon_taxonpath_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
|
|
4847 |
-- Name: taxonconcept_canon_taxonconcept_id_self_ref; Type: TRIGGER; Schema: public; Owner: -
|
|
4848 | 4848 |
-- |
4849 | 4849 |
|
4850 |
CREATE TRIGGER taxonpath_canon_taxonpath_id_self_ref BEFORE INSERT OR UPDATE ON taxonpath FOR EACH ROW EXECUTE PROCEDURE taxonpath_canon_taxonpath_id_self_ref();
|
|
4850 |
CREATE TRIGGER taxonconcept_canon_taxonconcept_id_self_ref BEFORE INSERT OR UPDATE ON taxonconcept FOR EACH ROW EXECUTE PROCEDURE taxonconcept_canon_taxonconcept_id_self_ref();
|
|
4851 | 4851 |
|
4852 | 4852 |
|
4853 | 4853 |
-- |
... | ... | |
5315 | 5315 |
|
5316 | 5316 |
|
5317 | 5317 |
-- |
5318 |
-- Name: methodtaxonclass_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5318 |
-- Name: methodtaxonclass_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5319 | 5319 |
-- |
5320 | 5320 |
|
5321 | 5321 |
ALTER TABLE ONLY methodtaxonclass |
5322 |
ADD CONSTRAINT methodtaxonclass_taxonpath_id_fkey FOREIGN KEY (taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5322 |
ADD CONSTRAINT methodtaxonclass_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5323 | 5323 |
|
5324 | 5324 |
|
5325 | 5325 |
-- |
... | ... | |
5435 | 5435 |
|
5436 | 5436 |
|
5437 | 5437 |
-- |
5438 |
-- Name: plantcorrelation_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5438 |
-- Name: plantcorrelation_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5439 | 5439 |
-- |
5440 | 5440 |
|
5441 | 5441 |
ALTER TABLE ONLY plantcorrelation |
5442 |
ADD CONSTRAINT plantcorrelation_taxonpath_id_fkey FOREIGN KEY (taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5442 |
ADD CONSTRAINT plantcorrelation_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5443 | 5443 |
|
5444 | 5444 |
|
5445 | 5445 |
-- |
... | ... | |
5499 | 5499 |
|
5500 | 5500 |
|
5501 | 5501 |
-- |
5502 |
-- Name: plantstatus_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5502 |
-- Name: plantstatus_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5503 | 5503 |
-- |
5504 | 5504 |
|
5505 | 5505 |
ALTER TABLE ONLY plantstatus |
5506 |
ADD CONSTRAINT plantstatus_taxonpath_id_fkey FOREIGN KEY (taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5506 |
ADD CONSTRAINT plantstatus_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5507 | 5507 |
|
5508 | 5508 |
|
5509 | 5509 |
-- |
... | ... | |
5531 | 5531 |
|
5532 | 5532 |
|
5533 | 5533 |
-- |
5534 |
-- Name: plantusage_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5534 |
-- Name: plantusage_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5535 | 5535 |
-- |
5536 | 5536 |
|
5537 | 5537 |
ALTER TABLE ONLY plantusage |
5538 |
ADD CONSTRAINT plantusage_taxonpath_id_fkey FOREIGN KEY (taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5538 |
ADD CONSTRAINT plantusage_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5539 | 5539 |
|
5540 | 5540 |
|
5541 | 5541 |
-- |
... | ... | |
5731 | 5731 |
|
5732 | 5732 |
|
5733 | 5733 |
-- |
5734 |
-- Name: taxonalt_taxondetermination_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5734 |
-- Name: taxonalt_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5735 | 5735 |
-- |
5736 | 5736 |
|
5737 | 5737 |
ALTER TABLE ONLY taxonalt |
5738 |
ADD CONSTRAINT taxonalt_taxondetermination_id_fkey FOREIGN KEY (taxondetermination_id) REFERENCES taxondetermination(taxondetermination_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5738 |
ADD CONSTRAINT taxonalt_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5739 | 5739 |
|
5740 | 5740 |
|
5741 | 5741 |
-- |
5742 |
-- Name: taxonalt_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5742 |
-- Name: taxonalt_taxondetermination_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5743 | 5743 |
-- |
5744 | 5744 |
|
5745 | 5745 |
ALTER TABLE ONLY taxonalt |
5746 |
ADD CONSTRAINT taxonalt_taxonpath_id_fkey FOREIGN KEY (taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5746 |
ADD CONSTRAINT taxonalt_taxondetermination_id_fkey FOREIGN KEY (taxondetermination_id) REFERENCES taxondetermination(taxondetermination_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5747 | 5747 |
|
5748 | 5748 |
|
5749 | 5749 |
-- |
5750 |
-- Name: taxondetermination_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5750 |
-- Name: taxonconcept_canon_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5751 | 5751 |
-- |
5752 | 5752 |
|
5753 |
ALTER TABLE ONLY taxondetermination
|
|
5754 |
ADD CONSTRAINT taxondetermination_party_id_fkey FOREIGN KEY (party_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5753 |
ALTER TABLE ONLY taxonconcept
|
|
5754 |
ADD CONSTRAINT taxonconcept_canon_taxonconcept_id_fkey FOREIGN KEY (canon_taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5755 | 5755 |
|
5756 | 5756 |
|
5757 | 5757 |
-- |
5758 |
-- Name: taxondetermination_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5758 |
-- Name: taxonconcept_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5759 | 5759 |
-- |
5760 | 5760 |
|
5761 |
ALTER TABLE ONLY taxondetermination
|
|
5762 |
ADD CONSTRAINT taxondetermination_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5761 |
ALTER TABLE ONLY taxonconcept
|
|
5762 |
ADD CONSTRAINT taxonconcept_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5763 | 5763 |
|
5764 | 5764 |
|
5765 | 5765 |
-- |
5766 |
-- Name: taxondetermination_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5766 |
-- Name: taxonconcept_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5767 | 5767 |
-- |
5768 | 5768 |
|
5769 |
ALTER TABLE ONLY taxondetermination
|
|
5770 |
ADD CONSTRAINT taxondetermination_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5769 |
ALTER TABLE ONLY taxonconcept
|
|
5770 |
ADD CONSTRAINT taxonconcept_scope_id_fkey FOREIGN KEY (scope_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5771 | 5771 |
|
5772 | 5772 |
|
5773 | 5773 |
-- |
5774 |
-- Name: taxondetermination_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5774 |
-- Name: taxonconcept_taxon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5775 | 5775 |
-- |
5776 | 5776 |
|
5777 |
ALTER TABLE ONLY taxondetermination
|
|
5778 |
ADD CONSTRAINT taxondetermination_taxonpath_id_fkey FOREIGN KEY (taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5777 |
ALTER TABLE ONLY taxonconcept
|
|
5778 |
ADD CONSTRAINT taxonconcept_taxon_id_fkey FOREIGN KEY (taxon_id) REFERENCES taxon(taxon_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5779 | 5779 |
|
5780 | 5780 |
|
5781 | 5781 |
-- |
5782 |
-- Name: taxonoccurrence_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5782 |
-- Name: taxondetermination_party_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5783 | 5783 |
-- |
5784 | 5784 |
|
5785 |
ALTER TABLE ONLY taxonoccurrence
|
|
5786 |
ADD CONSTRAINT taxonoccurrence_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5785 |
ALTER TABLE ONLY taxondetermination
|
|
5786 |
ADD CONSTRAINT taxondetermination_party_id_fkey FOREIGN KEY (party_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5787 | 5787 |
|
5788 | 5788 |
|
5789 | 5789 |
-- |
5790 |
-- Name: taxonoccurrence_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5790 |
-- Name: taxondetermination_reference_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5791 | 5791 |
-- |
5792 | 5792 |
|
5793 |
ALTER TABLE ONLY taxonoccurrence
|
|
5794 |
ADD CONSTRAINT taxonoccurrence_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5793 |
ALTER TABLE ONLY taxondetermination
|
|
5794 |
ADD CONSTRAINT taxondetermination_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(reference_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5795 | 5795 |
|
5796 | 5796 |
|
5797 | 5797 |
-- |
5798 |
-- Name: taxonpath_canon_taxonpath_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5798 |
-- Name: taxondetermination_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5799 | 5799 |
-- |
5800 | 5800 |
|
5801 |
ALTER TABLE ONLY taxonpath
|
|
5802 |
ADD CONSTRAINT taxonpath_canon_taxonpath_id_fkey FOREIGN KEY (canon_taxonpath_id) REFERENCES taxonpath(taxonpath_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5801 |
ALTER TABLE ONLY taxondetermination
|
|
5802 |
ADD CONSTRAINT taxondetermination_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5803 | 5803 |
|
5804 | 5804 |
|
5805 | 5805 |
-- |
5806 |
-- Name: taxonpath_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5806 |
-- Name: taxondetermination_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5807 | 5807 |
-- |
5808 | 5808 |
|
5809 |
ALTER TABLE ONLY taxonpath
|
|
5810 |
ADD CONSTRAINT taxonpath_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5809 |
ALTER TABLE ONLY taxondetermination
|
|
5810 |
ADD CONSTRAINT taxondetermination_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5811 | 5811 |
|
5812 | 5812 |
|
5813 | 5813 |
-- |
5814 |
-- Name: taxonpath_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5814 |
-- Name: taxonoccurrence_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5815 | 5815 |
-- |
5816 | 5816 |
|
5817 |
ALTER TABLE ONLY taxonpath
|
|
5818 |
ADD CONSTRAINT taxonpath_scope_id_fkey FOREIGN KEY (scope_id) REFERENCES taxonscope(taxonscope_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5817 |
ALTER TABLE ONLY taxonoccurrence
|
|
5818 |
ADD CONSTRAINT taxonoccurrence_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5819 | 5819 |
|
5820 | 5820 |
|
5821 | 5821 |
-- |
5822 |
-- Name: taxonpath_taxon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5822 |
-- Name: taxonoccurrence_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5823 | 5823 |
-- |
5824 | 5824 |
|
5825 |
ALTER TABLE ONLY taxonpath
|
|
5826 |
ADD CONSTRAINT taxonpath_taxon_id_fkey FOREIGN KEY (taxon_id) REFERENCES taxon(taxon_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5825 |
ALTER TABLE ONLY taxonoccurrence
|
|
5826 |
ADD CONSTRAINT taxonoccurrence_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5827 | 5827 |
|
5828 | 5828 |
|
5829 | 5829 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: Renamed taxonpath -> taxonconcept as part of taxonomic schema refactoring at <https://projects.nceas.ucsb.edu/nceas/projects/bien/wiki/2012-10-03_conference_call#Taxonomic-schema-refactoring>