Project

General

Profile

« Previous | Next » 

Revision 6946

do not insert duplicate GUID entries when adding rows from the xml_revisions table

View differences:

src/upgrade-db-to-2.0.0-oracle.sql
70 70
 */
71 71
INSERT INTO identifier (docid, rev, guid) 
72 72
	SELECT docid, rev, docid || '.' || rev FROM xml_documents;
73

  
73 74
INSERT INTO identifier (docid, rev, guid)
74
	SELECT docid, revisionid, docid || '.' || revisionid FROM xml_revisions;
75
	SELECT docid, revisionid, docid || '.' || revisionid 
76
	FROM xml_revisions
77
	WHERE docid || '.' || revisionid NOT IN (SELECT guid from identifier);
75 78

  
76 79
/*
77 80
 *  Allow guid in xml_access table (for system metadata)
src/upgrade-db-to-2.0.0-postgres.sql
74 74
 */
75 75
INSERT INTO identifier (docid, rev, guid) 
76 76
	SELECT docid, rev, docid || '.' || rev FROM xml_documents;
77

  
77 78
INSERT INTO identifier (docid, rev, guid)
78
	SELECT docid, revisionid, docid || '.' || revisionid FROM xml_revisions;
79
	SELECT docid, revisionid, docid || '.' || revisionid 
80
	FROM xml_revisions
81
	WHERE docid || '.' || revisionid NOT IN (SELECT guid from identifier);
79 82

  
80 83
/**
81 84
 *  Add guid in xml_access table

Also available in: Unified diff