Revision 6155
Added by Aaron Marcuse-Kubitza about 12 years ago
vegbank.~.clean_up.sql | ||
---|---|---|
420 | 420 |
ALTER TABLE taxoninterpretation DROP CONSTRAINT r9taxoninterpretation_museum_id; |
421 | 421 |
ALTER TABLE ONLY taxoninterpretation ADD CONSTRAINT r9taxoninterpretation_museum_id FOREIGN KEY (museum_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE; |
422 | 422 |
|
423 |
-- Remove private columns that should not be publicly visible
|
|
423 |
-- Remove private data that should not be publicly visible
|
|
424 | 424 |
ALTER TABLE plot DROP COLUMN reallatitude; |
425 | 425 |
ALTER TABLE plot DROP COLUMN reallongitude; |
426 | 426 |
|
427 | 427 |
DELETE FROM plot WHERE plot_id IN ( |
428 | 428 |
SELECT plot_id FROM embargo WHERE embargostop > now() |
429 | 429 |
); |
430 |
-- Do not delete confidentialitystatus >= 4 whose embargos have already expired |
|
431 |
-- This corresponds to location/public/full embargos (http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=plot&entity=dba_tabledescription&where=where_tablename#confidentialityStatus) |
|
430 | 432 |
|
431 | 433 |
-- Prevent "column name specified more than once" errors when tables are joined |
432 | 434 |
ALTER TABLE taxonobservation RENAME reference_id TO taxonobservation_reference_id; |
Also available in: Unified diff
inputs/VegBank/vegbank.~.clean_up.sql: Documented that plots with confidentialitystatus >= 4 are not deleted if their embargos have already expired. This applies to the Shenandoah NP data, which has confidentialitystatus = 5 but is no longer embargoed according to the embargo table