Project

General

Profile

Task #3621

Task #3612: CN SystemMetadata has incomplete obsoletedBy information

Correct revision history on LTER node

Added by Ben Leinfelder almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
2013-02-27
Due date:
% Done:

100%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

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 almost 12 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@

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)