Project

General

Profile

« Previous | Next » 

Revision 6762

only update accessfileid for our new guid-based records

View differences:

src/upgrade-db-to-2.0.0-postgres.sql
114 114
	WHERE docid like '%.%.%.%';
115 115

  
116 116
/**
117
 * Update the accessfileid to use guid
118
 * NOTE: uses the last revision's guid as the new accessfileid
117
 * Update the accessfileid to use their guid
118
 * NOTE: uses the last revision's guid as the new value for accessfileid
119 119
 */
120 120
UPDATE xml_access
121 121
SET accessfileid = id.guid
122 122
FROM identifier id, xml_access xa
123 123
WHERE xa.accessfileid = id.docid
124
AND xa.guid IS NOT null
124 125
AND id.rev = 
125 126
	(SELECT MAX(id2.rev) FROM identifier id2 WHERE id.docid = id2.docid)
126 127

  

Also available in: Unified diff