-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhargrett_cleanup_script.sql
83 lines (82 loc) · 7.48 KB
/
hargrett_cleanup_script.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* This runs several cleanup operations on our data before migration from Archivists' Toolkit to ArchivesSpace. It
updates digital objects to change their repository based on their METS Identifier, delete component unique identifier
(aka subdivisionIdentifier) content in that field, replaces leftover xml namespaces from note contents, set
resource level to file when it is collection, and update specific digital objects to University Archives (repository 6)
*/
UPDATE DigitalObjects SET repositoryId=4 WHERE repositoryId=6 AND metsIdentifier LIKE 'harg%';
UPDATE DigitalObjects SET repositoryId=9 WHERE metsIdentifier LIKE 'hmap%';
UPDATE ResourcesComponents SET subdivisionIdentifier = '' WHERE NOT subdivisionIdentifier='';
UPDATE ArchDescriptionRepeatingData SET noteContent = REPLACE(noteContent, '<p xmlns="urn:isbn:1-931666-22-9" xmlns:ns2="http://www.w3.org/1999/xlink">', '') WHERE INSTR(noteContent, '<p xmlns:ns2="urn:isbn:1-931666-22-9" xmlns:ns1="http://www.w3.org/1999/xlink">') OR INSTR(noteContent, '<p xmlns="urn:isbn:1-931666-22-9" xmlns:ns2="http://www.w3.org/1999/xlink">');
UPDATE ArchDescriptionRepeatingData SET noteContent = REPLACE(noteContent, '<p xmlns:ns2="urn:isbn:1-931666-22-9" xmlns:ns1="http://www.w3.org/1999/xlink">', '') WHERE INSTR(noteContent, '<p xmlns:ns2="urn:isbn:1-931666-22-9" xmlns:ns1="http://www.w3.org/1999/xlink">') OR INSTR(noteContent, '<p xmlns="urn:isbn:1-931666-22-9" xmlns:ns2="http://www.w3.org/1999/xlink">');
UPDATE ResourcesComponents SET resourceLevel = "file" WHERE resourceLevel = "collection";
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg0802-001-001-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-007';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-008';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-009';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-001-010';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-004';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-007';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-008';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-009';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-010';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-011';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-012';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-013';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-014';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-015';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-016';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-017';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-018';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-019';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002a-020';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002b-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002b-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002b-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002b-004';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg00-16-002b-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg97-106-001-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg97-106-001-007';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg97-106-016-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-073-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-073-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-073-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-073-004';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-073-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-073-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-004';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-007';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-074-008';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-004';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-007';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-008';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-075-009';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-001';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-002';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-003';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-004';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-005';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-006';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-007';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-008';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-009';
UPDATE DigitalObjects SET repositoryId=6 WHERE metsIdentifier = 'harg10-110-076-010';