Revision 12642
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/vegbien.my.sql | ||
---|---|---|
266 | 266 |
|
267 | 267 |
|
268 | 268 |
-- |
269 |
-- Name: keys_~type._plots_08_list_of_plots_which_use_percent_cover; Type: TYPE; Schema: public_validations; Owner: - |
|
270 |
-- |
|
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
|
275 |
-- |
|
269 | 276 |
-- Name: keys_~type._plots_10_count_of_individuals_per_plot_in_each_proj; Type: TYPE; Schema: public_validations; Owner: - |
270 | 277 |
-- |
271 | 278 |
|
... | ... | |
455 | 462 |
|
456 | 463 |
|
457 | 464 |
-- |
465 |
-- Name: values__~type._plots_08_list_of_plots_which_use_percent_cover; Type: TYPE; Schema: public_validations; Owner: - |
|
466 |
-- |
|
467 |
|
|
468 |
|
|
469 |
|
|
470 |
|
|
471 |
-- |
|
458 | 472 |
-- Name: values__~type._plots_10_count_of_individuals_per_plot_in_each_p; Type: TYPE; Schema: public_validations; Owner: - |
459 | 473 |
-- |
460 | 474 |
|
... | ... | |
1366 | 1380 |
|
1367 | 1381 |
|
1368 | 1382 |
-- |
1383 |
-- Name: ~type._plots_08_list_of_plots_which_use_percent_cover; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
1384 |
-- |
|
1385 |
|
|
1386 |
CREATE TABLE `~type._plots_08_list_of_plots_which_use_percent_cover` ( |
|
1387 |
project_name varchar(255), |
|
1388 |
plot_code varchar(255) |
|
1389 |
); |
|
1390 |
|
|
1391 |
|
|
1392 |
-- |
|
1393 |
-- Name: keys(`~type._plots_08_list_of_plots_which_use_percent_cover`); Type: FUNCTION; Schema: public_validations; Owner: - |
|
1394 |
-- |
|
1395 |
|
|
1396 |
|
|
1397 |
|
|
1398 |
|
|
1399 |
-- |
|
1369 | 1400 |
-- Name: ~type._plots_10_count_of_individuals_per_plot_in_each_project; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
1370 | 1401 |
-- |
1371 | 1402 |
|
... | ... | |
1902 | 1933 |
|
1903 | 1934 |
|
1904 | 1935 |
-- |
1936 |
-- Name: values_(`~type._plots_08_list_of_plots_which_use_percent_cover`); Type: FUNCTION; Schema: public_validations; Owner: - |
|
1937 |
-- |
|
1938 |
|
|
1939 |
|
|
1940 |
|
|
1941 |
|
|
1942 |
-- |
|
1905 | 1943 |
-- Name: values_(`~type._plots_10_count_of_individuals_per_plot_in_each_project`); Type: FUNCTION; Schema: public_validations; Owner: - |
1906 | 1944 |
-- |
1907 | 1945 |
|
... | ... | |
4696 | 4734 |
|
4697 | 4735 |
|
4698 | 4736 |
-- |
4737 |
-- Name: _plots_08_list_of_plots_which_use_percent_cover; Type: VIEW; Schema: public_validations; Owner: - |
|
4738 |
-- |
|
4739 |
|
|
4740 |
|
|
4741 |
|
|
4742 |
|
|
4743 |
-- |
|
4699 | 4744 |
-- Name: _plots_10_count_of_individuals_per_plot_in_each_project; Type: VIEW; Schema: public_validations; Owner: - |
4700 | 4745 |
-- |
4701 | 4746 |
|
... | ... | |
7738 | 7783 |
|
7739 | 7784 |
|
7740 | 7785 |
-- |
7786 |
-- Data for Name: ~type._plots_08_list_of_plots_which_use_percent_cover; Type: TABLE DATA; Schema: public_validations; Owner: - |
|
7787 |
-- |
|
7788 |
|
|
7789 |
|
|
7790 |
|
|
7791 |
-- |
|
7741 | 7792 |
-- Data for Name: ~type._plots_10_count_of_individuals_per_plot_in_each_project; Type: TABLE DATA; Schema: public_validations; Owner: - |
7742 | 7793 |
-- |
7743 | 7794 |
|
trunk/schemas/vegbien.sql | ||
---|---|---|
530 | 530 |
|
531 | 531 |
|
532 | 532 |
-- |
533 |
-- Name: keys_~type._plots_08_list_of_plots_which_use_percent_cover; Type: TYPE; Schema: public_validations; Owner: - |
|
534 |
-- |
|
535 |
|
|
536 |
CREATE TYPE "keys_~type._plots_08_list_of_plots_which_use_percent_cover" AS ( |
|
537 |
project_name text, |
|
538 |
plot_code text |
|
539 |
); |
|
540 |
|
|
541 |
|
|
542 |
-- |
|
533 | 543 |
-- Name: keys_~type._plots_10_count_of_individuals_per_plot_in_each_proj; Type: TYPE; Schema: public_validations; Owner: - |
534 | 544 |
-- |
535 | 545 |
|
... | ... | |
791 | 801 |
|
792 | 802 |
|
793 | 803 |
-- |
804 |
-- Name: values__~type._plots_08_list_of_plots_which_use_percent_cover; Type: TYPE; Schema: public_validations; Owner: - |
|
805 |
-- |
|
806 |
|
|
807 |
CREATE TYPE "values__~type._plots_08_list_of_plots_which_use_percent_cover" AS ( |
|
808 |
project_name text, |
|
809 |
plot_code text |
|
810 |
); |
|
811 |
|
|
812 |
|
|
813 |
-- |
|
794 | 814 |
-- Name: values__~type._plots_10_count_of_individuals_per_plot_in_each_p; Type: TYPE; Schema: public_validations; Owner: - |
795 | 815 |
-- |
796 | 816 |
|
... | ... | |
2656 | 2676 |
|
2657 | 2677 |
|
2658 | 2678 |
-- |
2679 |
-- Name: ~type._plots_08_list_of_plots_which_use_percent_cover; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
|
2680 |
-- |
|
2681 |
|
|
2682 |
CREATE TABLE "~type._plots_08_list_of_plots_which_use_percent_cover" ( |
|
2683 |
project_name text, |
|
2684 |
plot_code text |
|
2685 |
); |
|
2686 |
|
|
2687 |
|
|
2688 |
-- |
|
2689 |
-- Name: keys("~type._plots_08_list_of_plots_which_use_percent_cover"); Type: FUNCTION; Schema: public_validations; Owner: - |
|
2690 |
-- |
|
2691 |
|
|
2692 |
CREATE FUNCTION keys(value "~type._plots_08_list_of_plots_which_use_percent_cover") RETURNS "keys_~type._plots_08_list_of_plots_which_use_percent_cover" |
|
2693 |
LANGUAGE sql IMMUTABLE |
|
2694 |
AS $_$ |
|
2695 |
SELECT ROW($1.project_name, $1.plot_code)::public_validations."keys_~type._plots_08_list_of_plots_which_use_percent_cover" |
|
2696 |
$_$; |
|
2697 |
|
|
2698 |
|
|
2699 |
-- |
|
2659 | 2700 |
-- Name: ~type._plots_10_count_of_individuals_per_plot_in_each_project; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: |
2660 | 2701 |
-- |
2661 | 2702 |
|
... | ... | |
3596 | 3637 |
|
3597 | 3638 |
|
3598 | 3639 |
-- |
3640 |
-- Name: values_("~type._plots_08_list_of_plots_which_use_percent_cover"); Type: FUNCTION; Schema: public_validations; Owner: - |
|
3641 |
-- |
|
3642 |
|
|
3643 |
CREATE FUNCTION values_(value "~type._plots_08_list_of_plots_which_use_percent_cover") RETURNS "values__~type._plots_08_list_of_plots_which_use_percent_cover" |
|
3644 |
LANGUAGE sql IMMUTABLE |
|
3645 |
AS $_$ |
|
3646 |
SELECT ROW($1.project_name, $1.plot_code)::public_validations."values__~type._plots_08_list_of_plots_which_use_percent_cover" |
|
3647 |
$_$; |
|
3648 |
|
|
3649 |
|
|
3650 |
-- |
|
3599 | 3651 |
-- Name: values_("~type._plots_10_count_of_individuals_per_plot_in_each_project"); Type: FUNCTION; Schema: public_validations; Owner: - |
3600 | 3652 |
-- |
3601 | 3653 |
|
... | ... | |
7502 | 7554 |
|
7503 | 7555 |
|
7504 | 7556 |
-- |
7557 |
-- Name: _plots_08_list_of_plots_which_use_percent_cover; Type: VIEW; Schema: public_validations; Owner: - |
|
7558 |
-- |
|
7559 |
|
|
7560 |
CREATE VIEW _plots_08_list_of_plots_which_use_percent_cover AS |
|
7561 |
SELECT project.projectname AS project_name, |
|
7562 |
plot.authorlocationcode AS plot_code |
|
7563 |
FROM ((public.plot |
|
7564 |
JOIN public.locationevent USING (plot_id)) |
|
7565 |
LEFT JOIN public.project USING (project_id)) |
|
7566 |
WHERE ((plot.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND (EXISTS ( SELECT NULL::unknown AS unknown |
|
7567 |
FROM (((public.location |
|
7568 |
JOIN public.locationevent locationevent_1 USING (location_id)) |
|
7569 |
JOIN public.taxonoccurrence USING (locationevent_id)) |
|
7570 |
JOIN public.aggregateoccurrence USING (taxonoccurrence_id)) |
|
7571 |
WHERE ((location.plot_location_id = plot.plot_id) AND (aggregateoccurrence.cover_fraction IS NOT NULL)) |
|
7572 |
LIMIT 1))) |
|
7573 |
ORDER BY plot.authorlocationcode; |
|
7574 |
|
|
7575 |
|
|
7576 |
-- |
|
7505 | 7577 |
-- Name: _plots_10_count_of_individuals_per_plot_in_each_project; Type: VIEW; Schema: public_validations; Owner: - |
7506 | 7578 |
-- |
7507 | 7579 |
|
... | ... | |
10736 | 10808 |
|
10737 | 10809 |
|
10738 | 10810 |
-- |
10811 |
-- Data for Name: ~type._plots_08_list_of_plots_which_use_percent_cover; Type: TABLE DATA; Schema: public_validations; Owner: - |
|
10812 |
-- |
|
10813 |
|
|
10814 |
|
|
10815 |
|
|
10816 |
-- |
|
10739 | 10817 |
-- Data for Name: ~type._plots_10_count_of_individuals_per_plot_in_each_project; Type: TABLE DATA; Schema: public_validations; Owner: - |
10740 | 10818 |
-- |
10741 | 10819 |
|
Also available in: Unified diff
schemas/vegbien.sql: implemented _plots_08_list_of_plots_which_use_percent_cover