Project

General

Profile

« Previous | Next » 

Revision 13507

inputs/.TNRS/schema.sql: MatchedTaxon: to modify: use new MatchedTaxon_modify(), which eliminates the work of putting together the dependent views

View differences:

trunk/inputs/.TNRS/schema.sql
337 337

  
338 338
COMMENT ON VIEW "MatchedTaxon" IS '
339 339
to modify:
340
-- use `*, ... AS accepted_morphospecies_binomial` as the column list
341
SELECT util.force_recreate($$
342
-- trigger the dependent_objects_still_exist exception
343
DROP VIEW "TNRS"."MatchedTaxon"; -- *not* CASCADE; it must trigger an exception
344

  
345
CREATE VIEW "TNRS"."MatchedTaxon" AS 
346
SELECT *, ... AS accepted_morphospecies_binomial
347
/*revised def*/
348
;
349
GRANT SELECT ON TABLE "TNRS"."MatchedTaxon" TO bien_read;
350
COMMENT ON VIEW "TNRS"."MatchedTaxon"
351
  IS ''
352
...
353
'';
354

  
355
-- manually restore views that need to be updated for the changes
356
-- **IMPORTANT**: update these as described in the views'' comments
357

  
358
CREATE VIEW "TNRS"."ValidMatchedTaxon" AS 
359
 SELECT *
360
   FROM "TNRS"."MatchedTaxon"
361
  WHERE "MatchedTaxon".taxon_scrub__is_valid_match;
362
GRANT SELECT ON TABLE "TNRS"."ValidMatchedTaxon" TO bien_read;
363
COMMENT ON VIEW "TNRS"."ValidMatchedTaxon"
364
  IS ''
365
to update, use * as the column list
366
'';
367

  
368
CREATE VIEW "TNRS".taxon_scrub AS 
369
 SELECT *
370
   FROM "TNRS"."ValidMatchedTaxon"
371
   LEFT JOIN "TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name);
372
GRANT SELECT ON TABLE "TNRS".taxon_scrub TO bien_read;
373
COMMENT ON VIEW "TNRS".taxon_scrub
374
  IS ''
375
to update, use * as the column list
376
'';
340
SELECT "TNRS"."MatchedTaxon_modify"($$
341
 SELECT *, __ AS accepted_morphospecies_binomial
342
   FROM __
377 343
$$);
378 344
';
379 345

  
trunk/schemas/vegbien.my.sql
13288 13288

  
13289 13289

  
13290 13290

  
13291
-- manually restore views that need to be updated for the changes
13292
-- **IMPORTANT**: update these as described in the views'' comments
13293 13291

  
13294

  
13295

  
13296

  
13297

  
13298

  
13299

  
13300

  
13301

  
13302

  
13303 13292
--
13304 13293
-- Name: ValidMatchedTaxon; Type: VIEW; Schema: TNRS; Owner: -
13305 13294
--
trunk/schemas/vegbien.sql
17142 17142

  
17143 17143
COMMENT ON VIEW "MatchedTaxon" IS '
17144 17144
to modify:
17145
-- use `*, ... AS accepted_morphospecies_binomial` as the column list
17146
SELECT util.force_recreate($$
17147
-- trigger the dependent_objects_still_exist exception
17148
DROP VIEW "TNRS"."MatchedTaxon"; -- *not* CASCADE; it must trigger an exception
17149

  
17150
CREATE VIEW "TNRS"."MatchedTaxon" AS 
17151
SELECT *, ... AS accepted_morphospecies_binomial
17152
/*revised def*/
17153
;
17154
GRANT SELECT ON TABLE "TNRS"."MatchedTaxon" TO bien_read;
17155
COMMENT ON VIEW "TNRS"."MatchedTaxon"
17156
  IS ''
17157
...
17158
'';
17159

  
17160
-- manually restore views that need to be updated for the changes
17161
-- **IMPORTANT**: update these as described in the views'' comments
17162

  
17163
CREATE VIEW "TNRS"."ValidMatchedTaxon" AS 
17164
 SELECT *
17165
   FROM "TNRS"."MatchedTaxon"
17166
  WHERE "MatchedTaxon".taxon_scrub__is_valid_match;
17167
GRANT SELECT ON TABLE "TNRS"."ValidMatchedTaxon" TO bien_read;
17168
COMMENT ON VIEW "TNRS"."ValidMatchedTaxon"
17169
  IS ''
17170
to update, use * as the column list
17171
'';
17172

  
17173
CREATE VIEW "TNRS".taxon_scrub AS 
17174
 SELECT *
17175
   FROM "TNRS"."ValidMatchedTaxon"
17176
   LEFT JOIN "TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name);
17177
GRANT SELECT ON TABLE "TNRS".taxon_scrub TO bien_read;
17178
COMMENT ON VIEW "TNRS".taxon_scrub
17179
  IS ''
17180
to update, use * as the column list
17181
'';
17145
SELECT "TNRS"."MatchedTaxon_modify"($$
17146
 SELECT *, __ AS accepted_morphospecies_binomial
17147
   FROM __
17182 17148
$$);
17183 17149
';
17184 17150

  

Also available in: Unified diff