Project

General

Profile

1
/* Prevent "cannot alter type of a column used by a view or rule" errors when
2
cleanup operations are run using in place UPDATE */
3
DROP VIEW view_all_commnames_code CASCADE;
4
DROP VIEW view_all_commnames_common CASCADE;
5
DROP VIEW view_all_commnames_sciname CASCADE;
6
DROP VIEW view_all_commnames_translated CASCADE;
7
DROP VIEW view_all_plantnames_code CASCADE;
8
DROP VIEW view_all_plantnames_common CASCADE;
9
DROP VIEW view_all_plantnames_sciname CASCADE;
10
DROP VIEW view_all_plantnames_scinamenoauth CASCADE;
11
DROP VIEW view_notemb_observation CASCADE;
12
DROP VIEW view_browseparty_classcontrib CASCADE;
13
DROP VIEW view_browseparty_obscontrib CASCADE;
14
DROP VIEW view_browseparty_projectcontrib CASCADE;
15
DROP VIEW view_browseparty_all CASCADE;
16
DROP VIEW view_browseparty_all_count CASCADE;
17
DROP VIEW view_browseparty_classcontrib_count CASCADE;
18
DROP VIEW view_browseparty_obscontrib_count CASCADE;
19
DROP VIEW view_browseparty_projectcontrib_count CASCADE;
20
DROP VIEW view_browseparty_all_count_combined CASCADE;
21
DROP VIEW view_busrule_duplcovercode CASCADE;
22
DROP VIEW view_busrule_duplstratumtype CASCADE;
23
DROP VIEW view_busrule_plotsizeshape CASCADE;
24
DROP VIEW view_reference_transl CASCADE;
25
DROP VIEW view_commconcept_transl CASCADE;
26
DROP VIEW view_notemb_commclass CASCADE;
27
DROP VIEW view_comminterp_more CASCADE;
28
DROP VIEW view_csv_taxonimportance_pre CASCADE;
29
DROP VIEW view_csv_taxonimportance CASCADE;
30
DROP VIEW view_dbafielddesc_notimpl CASCADE;
31
DROP VIEW view_emb_embargo_currentfullonly CASCADE;
32
DROP VIEW view_emb_embargo_complete CASCADE;
33
DROP VIEW view_keywprojplaces CASCADE;
34
DROP VIEW view_kwhelper_projcontrib CASCADE;
35
DROP VIEW view_kwhelper_refjournal CASCADE;
36
DROP VIEW view_kwhelper_refparty CASCADE;
37
DROP VIEW view_notemb_classcontributor CASCADE;
38
DROP VIEW view_notemb_comminterpretation CASCADE;
39
DROP VIEW view_notemb_disturbanceobs CASCADE;
40
DROP VIEW view_notemb_plot CASCADE;
41
DROP VIEW view_notemb_soilobs CASCADE;
42
DROP VIEW view_notemb_stemcount CASCADE;
43
DROP VIEW view_notemb_stemlocation CASCADE;
44
DROP VIEW view_notemb_taxonalt CASCADE;
45
DROP VIEW view_notemb_taxonimportance CASCADE;
46
DROP VIEW view_notemb_taxoninterpretation CASCADE;
47
DROP VIEW view_notemb_taxonobservation CASCADE;
48
DROP VIEW view_observation_transl CASCADE;
49
DROP VIEW view_party_public CASCADE;
50
DROP VIEW view_party_transl CASCADE;
51
DROP VIEW view_plantconcept_transl CASCADE;
52
DROP VIEW view_plotall_withembargo CASCADE;
53
DROP VIEW view_std_commnames_code CASCADE;
54
DROP VIEW view_std_commnames_common CASCADE;
55
DROP VIEW view_std_commnames_sciname CASCADE;
56
DROP VIEW view_std_commnames_translated CASCADE;
57
DROP VIEW view_std_plantnames_code CASCADE;
58
DROP VIEW view_std_plantnames_common CASCADE;
59
DROP VIEW view_std_plantnames_sciname CASCADE;
60
DROP VIEW view_std_plantnames_scinamenoauth CASCADE;
61
DROP VIEW view_taxoninterp_more CASCADE;
62
DROP VIEW view_taxonobs_withmaxcover CASCADE;
63
DROP VIEW view_taxonobs_distinctid_curr CASCADE;
64
DROP VIEW view_taxonobs_distinctid_curr_counts CASCADE;
65
DROP VIEW view_taxonobs_distinctid_curr_counts_plants CASCADE;
66

    
67
-- Prevent "column name specified more than once" errors when tables are joined
68
ALTER TABLE taxonobservation RENAME reference_id  TO taxonobservation_reference_id;
69
ALTER TABLE taxonobservation RENAME accessioncode  TO taxonobservation_accessioncode;
70
ALTER TABLE taxoninterpretation RENAME plantname_id  TO taxoninterpretation_plantname_id;
71
ALTER TABLE taxoninterpretation RENAME accessioncode  TO taxoninterpretation_accessioncode;
72
ALTER TABLE plantconcept RENAME reference_id  TO plantconcept_reference_id;
73
ALTER TABLE plantconcept RENAME accessioncode  TO plantconcept_accessioncode;
(5-5/6)