Revision 13506
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/inputs/.TNRS/schema.sql | ||
---|---|---|
40 | 40 |
SET search_path = "TNRS", pg_catalog; |
41 | 41 |
|
42 | 42 |
-- |
43 |
-- Name: MatchedTaxon_modify(text); Type: FUNCTION; Schema: TNRS; Owner: - |
|
44 |
-- |
|
45 |
|
|
46 |
CREATE FUNCTION "MatchedTaxon_modify"(view_query text) RETURNS void |
|
47 |
LANGUAGE sql |
|
48 |
AS $_$ |
|
49 |
SELECT util.force_recreate($$ |
|
50 |
-- trigger the dependent_objects_still_exist exception |
|
51 |
DROP VIEW "TNRS"."MatchedTaxon"; -- *not* CASCADE; it must trigger an exception |
|
52 |
|
|
53 |
CREATE VIEW "TNRS"."MatchedTaxon" AS |
|
54 |
$$||$1||$$ |
|
55 |
; |
|
56 |
$$||util.mk_set_relation_metadata('"TNRS"."MatchedTaxon"')||$$ |
|
57 |
|
|
58 |
-- manually restore views that need to be updated for the changes |
|
59 |
-- **IMPORTANT**: keep these updated as described in the views' comments |
|
60 |
|
|
61 |
CREATE VIEW "TNRS"."ValidMatchedTaxon" AS |
|
62 |
SELECT * |
|
63 |
FROM "TNRS"."MatchedTaxon" |
|
64 |
WHERE "MatchedTaxon".taxon_scrub__is_valid_match; |
|
65 |
$$||util.mk_set_relation_metadata('"TNRS"."ValidMatchedTaxon"')||$$ |
|
66 |
|
|
67 |
CREATE VIEW "TNRS".taxon_scrub AS |
|
68 |
SELECT * |
|
69 |
FROM "TNRS"."ValidMatchedTaxon" |
|
70 |
LEFT JOIN "TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name); |
|
71 |
$$||util.mk_set_relation_metadata('"TNRS".taxon_scrub')||$$ |
|
72 |
$$); |
|
73 |
$_$; |
|
74 |
|
|
75 |
|
|
76 |
-- |
|
43 | 77 |
-- Name: batch__fill(); Type: FUNCTION; Schema: TNRS; Owner: - |
44 | 78 |
-- |
45 | 79 |
|
trunk/schemas/vegbien.my.sql | ||
---|---|---|
13151 | 13151 |
USE `TNRS`; |
13152 | 13152 |
|
13153 | 13153 |
-- |
13154 |
-- Name: MatchedTaxon_modify(varchar(255)); Type: FUNCTION; Schema: TNRS; Owner: - |
|
13155 |
-- |
|
13156 |
|
|
13157 |
|
|
13158 |
|
|
13159 |
|
|
13160 |
-- |
|
13154 | 13161 |
-- Name: batch__fill(); Type: FUNCTION; Schema: TNRS; Owner: - |
13155 | 13162 |
-- |
13156 | 13163 |
|
trunk/schemas/vegbien.sql | ||
---|---|---|
16803 | 16803 |
SET search_path = "TNRS", pg_catalog; |
16804 | 16804 |
|
16805 | 16805 |
-- |
16806 |
-- Name: MatchedTaxon_modify(text); Type: FUNCTION; Schema: TNRS; Owner: - |
|
16807 |
-- |
|
16808 |
|
|
16809 |
CREATE FUNCTION "MatchedTaxon_modify"(view_query text) RETURNS void |
|
16810 |
LANGUAGE sql |
|
16811 |
AS $_$ |
|
16812 |
SELECT util.force_recreate($$ |
|
16813 |
-- trigger the dependent_objects_still_exist exception |
|
16814 |
DROP VIEW "TNRS"."MatchedTaxon"; -- *not* CASCADE; it must trigger an exception |
|
16815 |
|
|
16816 |
CREATE VIEW "TNRS"."MatchedTaxon" AS |
|
16817 |
$$||$1||$$ |
|
16818 |
; |
|
16819 |
$$||util.mk_set_relation_metadata('"TNRS"."MatchedTaxon"')||$$ |
|
16820 |
|
|
16821 |
-- manually restore views that need to be updated for the changes |
|
16822 |
-- **IMPORTANT**: keep these updated as described in the views' comments |
|
16823 |
|
|
16824 |
CREATE VIEW "TNRS"."ValidMatchedTaxon" AS |
|
16825 |
SELECT * |
|
16826 |
FROM "TNRS"."MatchedTaxon" |
|
16827 |
WHERE "MatchedTaxon".taxon_scrub__is_valid_match; |
|
16828 |
$$||util.mk_set_relation_metadata('"TNRS"."ValidMatchedTaxon"')||$$ |
|
16829 |
|
|
16830 |
CREATE VIEW "TNRS".taxon_scrub AS |
|
16831 |
SELECT * |
|
16832 |
FROM "TNRS"."ValidMatchedTaxon" |
|
16833 |
LEFT JOIN "TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name); |
|
16834 |
$$||util.mk_set_relation_metadata('"TNRS".taxon_scrub')||$$ |
|
16835 |
$$); |
|
16836 |
$_$; |
|
16837 |
|
|
16838 |
|
|
16839 |
-- |
|
16806 | 16840 |
-- Name: batch__fill(); Type: FUNCTION; Schema: TNRS; Owner: - |
16807 | 16841 |
-- |
16808 | 16842 |
|
Also available in: Unified diff
inputs/.TNRS/schema.sql: added MatchedTaxon_modify()