Project

General

Profile

« Previous | Next » 

Revision 13501

inputs/.TNRS/schema.sql: MatchedTaxon: documented how to modify it (using util.force_recreate())

View differences:

trunk/inputs/.TNRS/schema.sql
299 299
--
300 300

  
301 301
COMMENT ON VIEW "MatchedTaxon" IS '
302
to update, use `*, ... AS accepted_morphospecies_binomial` as the column list
302
to modify:
303
-- use `*, ... AS accepted_morphospecies_binomial` as the column list
304
SELECT util.force_recreate($$
305
-- trigger the dependent_objects_still_exist exception
306
DROP VIEW "TNRS"."MatchedTaxon"; -- *not* CASCADE; it must trigger an exception
307

  
308
CREATE VIEW "TNRS"."MatchedTaxon" AS 
309
SELECT *, ... AS accepted_morphospecies_binomial
310
/*revised def*/
311
;
312
GRANT SELECT ON TABLE "TNRS"."MatchedTaxon" TO bien_read;
313
COMMENT ON VIEW "TNRS"."MatchedTaxon"
314
  IS ''
315
...
316
'';
317

  
318
-- manually restore views that need to be updated for the changes
319
-- **IMPORTANT**: update these as described in the views'' comments
320

  
321
CREATE VIEW "TNRS"."ValidMatchedTaxon" AS 
322
 SELECT *
323
   FROM "TNRS"."MatchedTaxon"
324
  WHERE "MatchedTaxon".taxon_scrub__is_valid_match;
325
GRANT SELECT ON TABLE "TNRS"."ValidMatchedTaxon" TO bien_read;
326
COMMENT ON VIEW "TNRS"."ValidMatchedTaxon"
327
  IS ''
328
to update, use * as the column list
329
'';
330

  
331
CREATE VIEW "TNRS".taxon_scrub AS 
332
 SELECT *
333
   FROM "TNRS"."ValidMatchedTaxon"
334
   LEFT JOIN "TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name);
335
GRANT SELECT ON TABLE "TNRS".taxon_scrub TO bien_read;
336
COMMENT ON VIEW "TNRS".taxon_scrub
337
  IS ''
338
to update, use * as the column list
339
'';
340
$$);
303 341
';
304 342

  
305 343

  
trunk/schemas/vegbien.my.sql
13281 13281

  
13282 13282

  
13283 13283

  
13284
-- manually restore views that need to be updated for the changes
13285
-- **IMPORTANT**: update these as described in the views'' comments
13284 13286

  
13287

  
13288

  
13289

  
13290

  
13291

  
13292

  
13293

  
13294

  
13295

  
13285 13296
--
13286 13297
-- Name: ValidMatchedTaxon; Type: VIEW; Schema: TNRS; Owner: -
13287 13298
--
trunk/schemas/vegbien.sql
17104 17104
--
17105 17105

  
17106 17106
COMMENT ON VIEW "MatchedTaxon" IS '
17107
to update, use `*, ... AS accepted_morphospecies_binomial` as the column list
17107
to modify:
17108
-- use `*, ... AS accepted_morphospecies_binomial` as the column list
17109
SELECT util.force_recreate($$
17110
-- trigger the dependent_objects_still_exist exception
17111
DROP VIEW "TNRS"."MatchedTaxon"; -- *not* CASCADE; it must trigger an exception
17112

  
17113
CREATE VIEW "TNRS"."MatchedTaxon" AS 
17114
SELECT *, ... AS accepted_morphospecies_binomial
17115
/*revised def*/
17116
;
17117
GRANT SELECT ON TABLE "TNRS"."MatchedTaxon" TO bien_read;
17118
COMMENT ON VIEW "TNRS"."MatchedTaxon"
17119
  IS ''
17120
...
17121
'';
17122

  
17123
-- manually restore views that need to be updated for the changes
17124
-- **IMPORTANT**: update these as described in the views'' comments
17125

  
17126
CREATE VIEW "TNRS"."ValidMatchedTaxon" AS 
17127
 SELECT *
17128
   FROM "TNRS"."MatchedTaxon"
17129
  WHERE "MatchedTaxon".taxon_scrub__is_valid_match;
17130
GRANT SELECT ON TABLE "TNRS"."ValidMatchedTaxon" TO bien_read;
17131
COMMENT ON VIEW "TNRS"."ValidMatchedTaxon"
17132
  IS ''
17133
to update, use * as the column list
17134
'';
17135

  
17136
CREATE VIEW "TNRS".taxon_scrub AS 
17137
 SELECT *
17138
   FROM "TNRS"."ValidMatchedTaxon"
17139
   LEFT JOIN "TNRS"."taxon_scrub.scrubbed_unique_taxon_name.*" USING (scrubbed_unique_taxon_name);
17140
GRANT SELECT ON TABLE "TNRS".taxon_scrub TO bien_read;
17141
COMMENT ON VIEW "TNRS".taxon_scrub
17142
  IS ''
17143
to update, use * as the column list
17144
'';
17145
$$);
17108 17146
';
17109 17147

  
17110 17148

  

Also available in: Unified diff