Revision 7392
Added by ben leinfelder over 11 years ago
GenerateGlobalIdentifiers.java | ||
---|---|---|
57 | 57 |
* xml_replication, then only convert the IDs for server 1 to GUIDs if the |
58 | 58 |
* property 'guid.ezid.doishoulder.1' defines a valid doi shoulder. |
59 | 59 |
* |
60 |
* NOTE: Metacat v2.0.5 has changed the name of the systemmetadata* tables to accommodate Oracle |
|
61 |
* length restrictions. The table names have been updated in this utility to enable |
|
62 |
* users to run this utility on v2.0.5+. You can only run this version of the utility on |
|
63 |
* Metacat deployments that have been upgraded to 2.0.5+ |
|
64 |
* |
|
60 | 65 |
* @author jones |
61 | 66 |
*/ |
62 | 67 |
public class GenerateGlobalIdentifiers implements UpgradeUtilityInterface { |
... | ... | |
153 | 158 |
// Convert other tables once, after the identifier table conversion has established the new |
154 | 159 |
// global identifiers to be used |
155 | 160 |
// This incudes: xml_access table, including accessfileid field, systemmetadata, |
156 |
// systemmetadatareplicationpolicy,and systemmetadatareplicationstatus tables
|
|
161 |
// smreplicationpolicy,and smreplicationstatus tables
|
|
157 | 162 |
convertIdentifierField(con, "xml_access", "guid"); |
158 | 163 |
convertIdentifierField(con, "xml_access", "accessfileid"); |
159 | 164 |
convertIdentifierField(con, "systemmetadata", "guid"); |
160 |
convertIdentifierField(con, "systemmetadatareplicationpolicy", "guid");
|
|
161 |
convertIdentifierField(con, "systemmetadatareplicationstatus", "guid");
|
|
165 |
convertIdentifierField(con, "smreplicationpolicy", "guid");
|
|
166 |
convertIdentifierField(con, "smreplicationstatus", "guid");
|
|
162 | 167 |
|
163 | 168 |
// Now clean up the temporary column we created, but note this makes it much |
164 | 169 |
// harder to revert our changes |
... | ... | |
169 | 174 |
/* |
170 | 175 |
// The following SQL commands will revert the changes made by this script as long as the identifier.old_guid column is intact |
171 | 176 |
start transaction; |
172 |
update systemmetadatareplicationstatus set guid = id.old_guid FROM identifier id WHERE systemmetadatareplicationstatus.guid = id.guid;
|
|
173 |
update systemmetadatareplicationpolicy set guid = id.old_guid FROM identifier id WHERE systemmetadatareplicationpolicy.guid = id.guid;
|
|
177 |
update smreplicationstatus set guid = id.old_guid FROM identifier id WHERE smreplicationstatus.guid = id.guid;
|
|
178 |
update smreplicationpolicy set guid = id.old_guid FROM identifier id WHERE smreplicationpolicy.guid = id.guid;
|
|
174 | 179 |
update systemmetadata set guid = id.old_guid FROM identifier id WHERE systemmetadata.guid = id.guid; |
175 | 180 |
update xml_access set accessfileid = id.old_guid FROM identifier id WHERE xml_access.accessfileid = id.guid; |
176 | 181 |
update xml_access set guid = id.old_guid FROM identifier id WHERE xml_access.guid = id.guid; |
Also available in: Unified diff
shorten the systemmetadata* table names for Oracle's 30 character limit. move version to 2.0.5. http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5717