Project

General

Profile

« Previous | Next » 

Revision 8366

include update statement for marking newer revisions

View differences:

src/system_metadata_revisions.sql
24 24
from systemmetadata sm, systemmetadata sm_s
25 25
where sm.guid = sm_s.obsoleted_by
26 26
and sm.obsoletes is null;
27
-- update them
28
BEGIN;
29
update systemmetadata sm
30
set obsoletes = sm_s.guid,
31
date_modified = now()
32
from systemmetadata sm_s
33
where sm.guid = sm_s.obsoleted_by
34
and sm.obsoletes is null;
35
--ROLLBACK;
36
COMMIT;
27 37

  
28 38
-- these are ones that should be marked as archived=true but are not
29 39
select sm. guid --count(sm.guid)
......
36 46
-- update them
37 47
BEGIN;
38 48
update systemmetadata sm
39
set archived = true
49
set archived = true,
50
date_modified = now()
40 51
from identifier id
41 52
where sm.guid = id.guid
42 53
and not exists (select * from xml_documents doc where doc.docid = id.docid and doc.rev = id.rev)

Also available in: Unified diff