Revision 6482
Added by Aaron Marcuse-Kubitza about 12 years ago
vegbien.sql | ||
---|---|---|
1294 | 1294 |
|
1295 | 1295 |
|
1296 | 1296 |
-- |
1297 |
-- Name: analytical_aggregate; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
1298 |
-- |
|
1299 |
|
|
1300 |
CREATE TABLE analytical_aggregate ( |
|
1301 |
"institutionCode" text NOT NULL, |
|
1302 |
country text, |
|
1303 |
"stateProvince" text, |
|
1304 |
county text, |
|
1305 |
"decimalLatitude" double precision, |
|
1306 |
"decimalLongitude" double precision, |
|
1307 |
"coordinateUncertaintyInMeters" double precision, |
|
1308 |
geovalid boolean, |
|
1309 |
"isNewWorld" boolean, |
|
1310 |
"distanceToCountry_km" double precision, |
|
1311 |
"distanceToStateProvince_km" double precision, |
|
1312 |
"plotName" text NOT NULL, |
|
1313 |
"elevationInMeters" double precision, |
|
1314 |
"plotArea_ha" double precision, |
|
1315 |
"samplingProtocol" text, |
|
1316 |
"dateCollected" date NOT NULL, |
|
1317 |
"higherPlantGroup" higher_plant_group, |
|
1318 |
family text, |
|
1319 |
genus text, |
|
1320 |
"speciesBinomial" text, |
|
1321 |
"scientificName" text, |
|
1322 |
"scientificNameAuthorship" text, |
|
1323 |
"scientificNameWithMorphospecies" text, |
|
1324 |
threatened boolean, |
|
1325 |
"identifiedBy" text, |
|
1326 |
"growthForm" growthform, |
|
1327 |
cultivated boolean, |
|
1328 |
"cultivatedBasis" text, |
|
1329 |
"coverPercent" double precision, |
|
1330 |
"individualCount" bigint, |
|
1331 |
"individualCount_1cm_or_more" bigint, |
|
1332 |
"individualCount_2_5cm_or_more" bigint, |
|
1333 |
"individualCount_10cm_or_more" bigint |
|
1334 |
); |
|
1335 |
|
|
1336 |
|
|
1337 |
-- |
|
1338 |
-- Name: analytical_stem; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
1339 |
-- |
|
1340 |
|
|
1341 |
CREATE TABLE analytical_stem ( |
|
1342 |
"institutionCode" text NOT NULL, |
|
1343 |
country text, |
|
1344 |
"stateProvince" text, |
|
1345 |
county text, |
|
1346 |
"decimalLatitude" double precision, |
|
1347 |
"decimalLongitude" double precision, |
|
1348 |
"coordinateUncertaintyInMeters" double precision, |
|
1349 |
geovalid boolean, |
|
1350 |
"isNewWorld" boolean, |
|
1351 |
"distanceToCountry_km" double precision, |
|
1352 |
"distanceToStateProvince_km" double precision, |
|
1353 |
"plotName" text NOT NULL, |
|
1354 |
"elevationInMeters" double precision, |
|
1355 |
"plotArea_ha" double precision, |
|
1356 |
"samplingProtocol" text, |
|
1357 |
"dateCollected" date NOT NULL, |
|
1358 |
"higherPlantGroup" higher_plant_group, |
|
1359 |
family text, |
|
1360 |
genus text, |
|
1361 |
"speciesBinomial" text, |
|
1362 |
"scientificName" text, |
|
1363 |
"scientificNameAuthorship" text, |
|
1364 |
"scientificNameWithMorphospecies" text, |
|
1365 |
threatened boolean, |
|
1366 |
"identifiedBy" text, |
|
1367 |
"growthForm" growthform, |
|
1368 |
cultivated boolean, |
|
1369 |
"cultivatedBasis" text, |
|
1370 |
"coverPercent" double precision, |
|
1371 |
"diameterBreastHeight_cm" double precision, |
|
1372 |
height_m double precision, |
|
1373 |
tag text, |
|
1374 |
"organismX_m" double precision, |
|
1375 |
"organismY_m" double precision, |
|
1376 |
"recordedBy" text, |
|
1377 |
"recordNumber" text |
|
1378 |
); |
|
1379 |
|
|
1380 |
|
|
1381 |
-- |
|
1382 | 1297 |
-- Name: address; Type: TABLE; Schema: public; Owner: -; Tablespace: |
1383 | 1298 |
-- |
1384 | 1299 |
|
... | ... | |
1497 | 1412 |
|
1498 | 1413 |
|
1499 | 1414 |
-- |
1415 |
-- Name: analytical_aggregate; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
1416 |
-- |
|
1417 |
|
|
1418 |
CREATE TABLE analytical_aggregate ( |
|
1419 |
"institutionCode" text NOT NULL, |
|
1420 |
country text, |
|
1421 |
"stateProvince" text, |
|
1422 |
county text, |
|
1423 |
"decimalLatitude" double precision, |
|
1424 |
"decimalLongitude" double precision, |
|
1425 |
"coordinateUncertaintyInMeters" double precision, |
|
1426 |
geovalid boolean, |
|
1427 |
"isNewWorld" boolean, |
|
1428 |
"distanceToCountry_km" double precision, |
|
1429 |
"distanceToStateProvince_km" double precision, |
|
1430 |
"plotName" text NOT NULL, |
|
1431 |
"elevationInMeters" double precision, |
|
1432 |
"plotArea_ha" double precision, |
|
1433 |
"samplingProtocol" text, |
|
1434 |
"dateCollected" date NOT NULL, |
|
1435 |
"higherPlantGroup" higher_plant_group, |
|
1436 |
family text, |
|
1437 |
genus text, |
|
1438 |
"speciesBinomial" text, |
|
1439 |
"scientificName" text, |
|
1440 |
"scientificNameAuthorship" text, |
|
1441 |
"scientificNameWithMorphospecies" text, |
|
1442 |
threatened boolean, |
|
1443 |
"identifiedBy" text, |
|
1444 |
"growthForm" growthform, |
|
1445 |
cultivated boolean, |
|
1446 |
"cultivatedBasis" text, |
|
1447 |
"coverPercent" double precision, |
|
1448 |
"individualCount" bigint, |
|
1449 |
"individualCount_1cm_or_more" bigint, |
|
1450 |
"individualCount_2_5cm_or_more" bigint, |
|
1451 |
"individualCount_10cm_or_more" bigint |
|
1452 |
); |
|
1453 |
|
|
1454 |
|
|
1455 |
-- |
|
1456 |
-- Name: analytical_stem; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
1457 |
-- |
|
1458 |
|
|
1459 |
CREATE TABLE analytical_stem ( |
|
1460 |
"institutionCode" text NOT NULL, |
|
1461 |
country text, |
|
1462 |
"stateProvince" text, |
|
1463 |
county text, |
|
1464 |
"decimalLatitude" double precision, |
|
1465 |
"decimalLongitude" double precision, |
|
1466 |
"coordinateUncertaintyInMeters" double precision, |
|
1467 |
geovalid boolean, |
|
1468 |
"isNewWorld" boolean, |
|
1469 |
"distanceToCountry_km" double precision, |
|
1470 |
"distanceToStateProvince_km" double precision, |
|
1471 |
"plotName" text NOT NULL, |
|
1472 |
"elevationInMeters" double precision, |
|
1473 |
"plotArea_ha" double precision, |
|
1474 |
"samplingProtocol" text, |
|
1475 |
"dateCollected" date NOT NULL, |
|
1476 |
"higherPlantGroup" higher_plant_group, |
|
1477 |
family text, |
|
1478 |
genus text, |
|
1479 |
"speciesBinomial" text, |
|
1480 |
"scientificName" text, |
|
1481 |
"scientificNameAuthorship" text, |
|
1482 |
"scientificNameWithMorphospecies" text, |
|
1483 |
threatened boolean, |
|
1484 |
"identifiedBy" text, |
|
1485 |
"growthForm" growthform, |
|
1486 |
cultivated boolean, |
|
1487 |
"cultivatedBasis" text, |
|
1488 |
"coverPercent" double precision, |
|
1489 |
"diameterBreastHeight_cm" double precision, |
|
1490 |
height_m double precision, |
|
1491 |
tag text, |
|
1492 |
"organismX_m" double precision, |
|
1493 |
"organismY_m" double precision, |
|
1494 |
"recordedBy" text, |
|
1495 |
"recordNumber" text |
|
1496 |
); |
|
1497 |
|
|
1498 |
|
|
1499 |
-- |
|
1500 | 1500 |
-- Name: analytical_aggregate_view; Type: VIEW; Schema: public; Owner: - |
1501 | 1501 |
-- |
1502 | 1502 |
|
... | ... | |
3564 | 3564 |
|
3565 | 3565 |
|
3566 | 3566 |
-- |
3567 |
-- Name: soilobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
3567 |
-- Name: soilsample; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
|
3568 | 3568 |
-- |
3569 | 3569 |
|
3570 |
CREATE TABLE soilobs (
|
|
3571 |
soilobs_id integer NOT NULL,
|
|
3570 |
CREATE TABLE soilsample (
|
|
3571 |
soilsample_id integer NOT NULL,
|
|
3572 | 3572 |
locationevent_id integer NOT NULL, |
3573 | 3573 |
horizon text DEFAULT 'unknown'::text NOT NULL, |
3574 | 3574 |
description text, |
... | ... | |
3597 | 3597 |
|
3598 | 3598 |
|
3599 | 3599 |
-- |
3600 |
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3600 |
-- Name: soilsample_soilsample_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
3601 | 3601 |
-- |
3602 | 3602 |
|
3603 |
CREATE SEQUENCE soilobs_soilobs_id_seq
|
|
3603 |
CREATE SEQUENCE soilsample_soilsample_id_seq
|
|
3604 | 3604 |
START WITH 1 |
3605 | 3605 |
INCREMENT BY 1 |
3606 | 3606 |
NO MINVALUE |
... | ... | |
3609 | 3609 |
|
3610 | 3610 |
|
3611 | 3611 |
-- |
3612 |
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3612 |
-- Name: soilsample_soilsample_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
3613 | 3613 |
-- |
3614 | 3614 |
|
3615 |
ALTER SEQUENCE soilobs_soilobs_id_seq OWNED BY soilobs.soilobs_id;
|
|
3615 |
ALTER SEQUENCE soilsample_soilsample_id_seq OWNED BY soilsample.soilsample_id;
|
|
3616 | 3616 |
|
3617 | 3617 |
|
3618 | 3618 |
-- |
3619 |
-- Name: soilobs_soilobs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
|
|
3619 |
-- Name: soilsample_soilsample_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
|
|
3620 | 3620 |
-- |
3621 | 3621 |
|
3622 | 3622 |
|
... | ... | |
4684 | 4684 |
|
4685 | 4685 |
|
4686 | 4686 |
-- |
4687 |
-- Name: soilobs_id; Type: DEFAULT; Schema: public; Owner: -
|
|
4687 |
-- Name: soilsample_id; Type: DEFAULT; Schema: public; Owner: -
|
|
4688 | 4688 |
-- |
4689 | 4689 |
|
4690 |
ALTER TABLE ONLY soilobs ALTER COLUMN soilobs_id SET DEFAULT nextval('soilobs_soilobs_id_seq'::regclass);
|
|
4690 |
ALTER TABLE ONLY soilsample ALTER COLUMN soilsample_id SET DEFAULT nextval('soilsample_soilsample_id_seq'::regclass);
|
|
4691 | 4691 |
|
4692 | 4692 |
|
4693 | 4693 |
-- |
... | ... | |
5162 | 5162 |
|
5163 | 5163 |
|
5164 | 5164 |
-- |
5165 |
-- Data for Name: soilobs; Type: TABLE DATA; Schema: public; Owner: -
|
|
5165 |
-- Data for Name: soilsample; Type: TABLE DATA; Schema: public; Owner: -
|
|
5166 | 5166 |
-- |
5167 | 5167 |
|
5168 | 5168 |
|
... | ... | |
5674 | 5674 |
|
5675 | 5675 |
|
5676 | 5676 |
-- |
5677 |
-- Name: soilobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
5677 |
-- Name: soilsample_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
5678 | 5678 |
-- |
5679 | 5679 |
|
5680 |
ALTER TABLE ONLY soilobs
|
|
5681 |
ADD CONSTRAINT soilobs_pkey PRIMARY KEY (soilobs_id);
|
|
5680 |
ALTER TABLE ONLY soilsample
|
|
5681 |
ADD CONSTRAINT soilsample_pkey PRIMARY KEY (soilsample_id);
|
|
5682 | 5682 |
|
5683 | 5683 |
|
5684 | 5684 |
-- |
5685 |
-- Name: soilobs_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
5685 |
-- Name: soilsample_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
5686 | 5686 |
-- |
5687 | 5687 |
|
5688 |
ALTER TABLE ONLY soilobs
|
|
5689 |
ADD CONSTRAINT soilobs_unique UNIQUE (locationevent_id);
|
|
5688 |
ALTER TABLE ONLY soilsample
|
|
5689 |
ADD CONSTRAINT soilsample_unique UNIQUE (locationevent_id);
|
|
5690 | 5690 |
|
5691 | 5691 |
|
5692 | 5692 |
-- |
... | ... | |
7128 | 7128 |
|
7129 | 7129 |
|
7130 | 7130 |
-- |
7131 |
-- Name: soilobs_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
7131 |
-- Name: soilsample_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
7132 | 7132 |
-- |
7133 | 7133 |
|
7134 |
ALTER TABLE ONLY soilobs
|
|
7135 |
ADD CONSTRAINT soilobs_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
7134 |
ALTER TABLE ONLY soilsample
|
|
7135 |
ADD CONSTRAINT soilsample_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
7136 | 7136 |
|
7137 | 7137 |
|
7138 | 7138 |
-- |
... | ... | |
7526 | 7526 |
|
7527 | 7527 |
|
7528 | 7528 |
-- |
7529 |
-- Name: analytical_stem; Type: ACL; Schema: public; Owner: - |
|
7530 |
-- |
|
7531 |
|
|
7532 |
REVOKE ALL ON TABLE analytical_stem FROM PUBLIC; |
|
7533 |
REVOKE ALL ON TABLE analytical_stem FROM bien; |
|
7534 |
GRANT ALL ON TABLE analytical_stem TO bien; |
|
7535 |
GRANT SELECT ON TABLE analytical_stem TO bien_read; |
|
7536 |
|
|
7537 |
|
|
7538 |
-- |
|
7539 | 7529 |
-- Name: address; Type: ACL; Schema: public; Owner: - |
7540 | 7530 |
-- |
7541 | 7531 |
|
... | ... | |
7556 | 7546 |
|
7557 | 7547 |
|
7558 | 7548 |
-- |
7549 |
-- Name: analytical_stem; Type: ACL; Schema: public; Owner: - |
|
7550 |
-- |
|
7551 |
|
|
7552 |
REVOKE ALL ON TABLE analytical_stem FROM PUBLIC; |
|
7553 |
REVOKE ALL ON TABLE analytical_stem FROM bien; |
|
7554 |
GRANT ALL ON TABLE analytical_stem TO bien; |
|
7555 |
GRANT SELECT ON TABLE analytical_stem TO bien_read; |
|
7556 |
|
|
7557 |
|
|
7558 |
-- |
|
7559 | 7559 |
-- Name: analytical_aggregate_view; Type: ACL; Schema: public; Owner: - |
7560 | 7560 |
-- |
7561 | 7561 |
|
... | ... | |
8026 | 8026 |
|
8027 | 8027 |
|
8028 | 8028 |
-- |
8029 |
-- Name: soilobs; Type: ACL; Schema: public; Owner: -
|
|
8029 |
-- Name: soilsample; Type: ACL; Schema: public; Owner: -
|
|
8030 | 8030 |
-- |
8031 | 8031 |
|
8032 |
REVOKE ALL ON TABLE soilobs FROM PUBLIC;
|
|
8033 |
REVOKE ALL ON TABLE soilobs FROM bien;
|
|
8034 |
GRANT ALL ON TABLE soilobs TO bien;
|
|
8035 |
GRANT SELECT ON TABLE soilobs TO bien_read;
|
|
8032 |
REVOKE ALL ON TABLE soilsample FROM PUBLIC;
|
|
8033 |
REVOKE ALL ON TABLE soilsample FROM bien;
|
|
8034 |
GRANT ALL ON TABLE soilsample TO bien;
|
|
8035 |
GRANT SELECT ON TABLE soilsample TO bien_read;
|
|
8036 | 8036 |
|
8037 | 8037 |
|
8038 | 8038 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: Renamed soilobs to soilsample per working group discussion