Project

General

Profile

« Previous | Next » 

Revision 13506

inputs/.TNRS/schema.sql: added MatchedTaxon_modify()

View differences:

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

  

Also available in: Unified diff