Task #3621
Task #3612: CN SystemMetadata has incomplete obsoletedBy information
Correct revision history on LTER node
100%
Description
I believe the LTER node is in better shape, but it would be good to verify and correct any incomplete revision history to make sure the old revision has an obsoletedBy element.
To correct this, the following SQL can be used (first to investigate, and finally to update the objects in question).
https://code.ecoinformatics.org/code/metacat/trunk/src/system_metadata_revisions.sql
History
#1 Updated by Mark Servilla over 11 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
- translation missing: en.field_remaining_hours set to 0.0
The noted SQL script was executed on 6 March 2013 at approximately 12:30PM MST.
@metacat=# update systemmetadata sm
metacat-# set obsoleted_by = sm_by.guid,
metacat-# date_modified = now()
metacat-# from systemmetadata sm_by
metacat-# where sm.guid = sm_by.obsoletes
metacat-# and sm.obsoleted_by is null;
UPDATE 1145@
@metacat=# update systemmetadata sm
metacat-# set archived = true
metacat-# from identifier id
metacat-# where sm.guid = id.guid
metacat-# and not exists (select * from xml_documents doc where doc.docid = id.docid and doc.rev = id.rev)
metacat-# and sm.archived != true
metacat-# and sm.obsoleted_by is null;
UPDATE 940@