Lines 12-22
return {
Link Here
|
12 |
VALUES ('ERMModule', '0', NULL, 'Enable the E-Resource management module', 'YesNo'); |
12 |
VALUES ('ERMModule', '0', NULL, 'Enable the E-Resource management module', 'YesNo'); |
13 |
}); |
13 |
}); |
14 |
|
14 |
|
|
|
15 |
say $out "Added new system preference 'ERMModule'"; |
16 |
|
15 |
$dbh->do(q{ |
17 |
$dbh->do(q{ |
16 |
INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) |
18 |
INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) |
17 |
VALUES (28, 'erm', 'Manage electronic resources', 0) |
19 |
VALUES (28, 'erm', 'Manage electronic resources', 0) |
18 |
}); |
20 |
}); |
19 |
|
21 |
|
|
|
22 |
say $out "Added new permission 'erm'"; |
23 |
|
20 |
unless ( TableExists('erm_agreements') ) { |
24 |
unless ( TableExists('erm_agreements') ) { |
21 |
$dbh->do(q{ |
25 |
$dbh->do(q{ |
22 |
CREATE TABLE `erm_agreements` ( |
26 |
CREATE TABLE `erm_agreements` ( |
Lines 33-38
return {
Link Here
|
33 |
PRIMARY KEY(`agreement_id`) |
37 |
PRIMARY KEY(`agreement_id`) |
34 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
38 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
35 |
}); |
39 |
}); |
|
|
40 |
|
41 |
say $out "Added new table 'erm_agreements'"; |
36 |
} |
42 |
} |
37 |
|
43 |
|
38 |
$dbh->do(q{ |
44 |
$dbh->do(q{ |
Lines 68-73
return {
Link Here
|
68 |
PRIMARY KEY(`agreement_period_id`) |
74 |
PRIMARY KEY(`agreement_period_id`) |
69 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
75 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
70 |
}); |
76 |
}); |
|
|
77 |
|
78 |
say $out "Added new table 'erm_agreement_periods'"; |
71 |
} |
79 |
} |
72 |
unless ( TableExists('erm_licenses') ) { |
80 |
unless ( TableExists('erm_licenses') ) { |
73 |
$dbh->do(q{ |
81 |
$dbh->do(q{ |
Lines 84-89
return {
Link Here
|
84 |
PRIMARY KEY(`license_id`) |
92 |
PRIMARY KEY(`license_id`) |
85 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
93 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
86 |
}); |
94 |
}); |
|
|
95 |
|
96 |
say $out "Added new table 'erm_licenses'"; |
87 |
} |
97 |
} |
88 |
unless ( TableExists('erm_agreement_licenses') ) { |
98 |
unless ( TableExists('erm_agreement_licenses') ) { |
89 |
$dbh->do(q{ |
99 |
$dbh->do(q{ |
Lines 101-106
return {
Link Here
|
101 |
UNIQUE KEY `erm_agreement_licenses_uniq` (`agreement_id`, `license_id`) |
111 |
UNIQUE KEY `erm_agreement_licenses_uniq` (`agreement_id`, `license_id`) |
102 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
112 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
103 |
}); |
113 |
}); |
|
|
114 |
|
115 |
say $out "Added new table 'erm_agreement_licenses'"; |
104 |
} |
116 |
} |
105 |
$dbh->do(q{ |
117 |
$dbh->do(q{ |
106 |
INSERT IGNORE INTO authorised_value_categories (category_name, is_system) |
118 |
INSERT IGNORE INTO authorised_value_categories (category_name, is_system) |
Lines 142-147
return {
Link Here
|
142 |
CONSTRAINT `erm_user_roles_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE |
154 |
CONSTRAINT `erm_user_roles_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE |
143 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
155 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
144 |
}); |
156 |
}); |
|
|
157 |
|
158 |
say $out "Added new table 'erm_user_roles'"; |
145 |
} |
159 |
} |
146 |
$dbh->do(q{ |
160 |
$dbh->do(q{ |
147 |
INSERT IGNORE INTO authorised_value_categories (category_name, is_system) |
161 |
INSERT IGNORE INTO authorised_value_categories (category_name, is_system) |
Lines 167-172
return {
Link Here
|
167 |
PRIMARY KEY(`agreement_id`, `related_agreement_id`) |
181 |
PRIMARY KEY(`agreement_id`, `related_agreement_id`) |
168 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
182 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
169 |
}); |
183 |
}); |
|
|
184 |
|
185 |
say $out "Added new table 'erm_agreement_relationships'"; |
170 |
} |
186 |
} |
171 |
|
187 |
|
172 |
unless ( TableExists('erm_documents') ) { |
188 |
unless ( TableExists('erm_documents') ) { |
Lines 188-193
return {
Link Here
|
188 |
PRIMARY KEY(`document_id`) |
204 |
PRIMARY KEY(`document_id`) |
189 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
205 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
190 |
}); |
206 |
}); |
|
|
207 |
|
208 |
say $out "Added new table 'erm_documents'"; |
191 |
} |
209 |
} |
192 |
|
210 |
|
193 |
unless ( TableExists('erm_eholdings_packages') ) { |
211 |
unless ( TableExists('erm_eholdings_packages') ) { |
Lines 206-211
return {
Link Here
|
206 |
PRIMARY KEY(`package_id`) |
224 |
PRIMARY KEY(`package_id`) |
207 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
225 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
208 |
}); |
226 |
}); |
|
|
227 |
|
228 |
say $out "Added new table 'erm_eholdings_packages'"; |
209 |
} |
229 |
} |
210 |
|
230 |
|
211 |
unless ( TableExists('erm_eholdings_packages_agreements') ) { |
231 |
unless ( TableExists('erm_eholdings_packages_agreements') ) { |
Lines 218-223
return {
Link Here
|
218 |
CONSTRAINT `erm_eholdings_packages_agreements_ibfk_2` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE |
238 |
CONSTRAINT `erm_eholdings_packages_agreements_ibfk_2` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE |
219 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
239 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
220 |
}); |
240 |
}); |
|
|
241 |
|
242 |
say $out "Added new table 'erm_eholdings_packages_agreements'"; |
221 |
} |
243 |
} |
222 |
|
244 |
|
223 |
unless ( TableExists('erm_eholdings_titles') ) { |
245 |
unless ( TableExists('erm_eholdings_titles') ) { |
Lines 254-259
return {
Link Here
|
254 |
PRIMARY KEY(`title_id`) |
276 |
PRIMARY KEY(`title_id`) |
255 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
277 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
256 |
}); |
278 |
}); |
|
|
279 |
|
280 |
say $out "Added new table 'erm_eholdings_titles'"; |
257 |
} |
281 |
} |
258 |
unless ( TableExists('erm_eholdings_resources') ) { |
282 |
unless ( TableExists('erm_eholdings_resources') ) { |
259 |
$dbh->do(q{ |
283 |
$dbh->do(q{ |
Lines 272-277
return {
Link Here
|
272 |
PRIMARY KEY(`resource_id`) |
296 |
PRIMARY KEY(`resource_id`) |
273 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
297 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
274 |
}); |
298 |
}); |
|
|
299 |
|
300 |
say $out "Added new table 'erm_eholdings_resources'"; |
275 |
} |
301 |
} |
276 |
|
302 |
|
277 |
unless ( column_exists('aqbooksellers', 'external_id') ) { |
303 |
unless ( column_exists('aqbooksellers', 'external_id') ) { |
Lines 280-285
return {
Link Here
|
280 |
ADD COLUMN `external_id` VARCHAR(255) DEFAULT NULL |
306 |
ADD COLUMN `external_id` VARCHAR(255) DEFAULT NULL |
281 |
AFTER `deliverytime` |
307 |
AFTER `deliverytime` |
282 |
}); |
308 |
}); |
|
|
309 |
|
310 |
say $out "Added column 'aqbooksellers.external_id'"; |
283 |
} |
311 |
} |
284 |
|
312 |
|
285 |
$dbh->do(q{ |
313 |
$dbh->do(q{ |
Lines 325-330
return {
Link Here
|
325 |
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) |
353 |
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) |
326 |
VALUES ('ERMProviders', 'local', 'local|ebsco', 'Set the providers for the ERM module', 'multiple'); |
354 |
VALUES ('ERMProviders', 'local', 'local|ebsco', 'Set the providers for the ERM module', 'multiple'); |
327 |
}); |
355 |
}); |
|
|
356 |
|
357 |
say $out "Added new system preference 'ERMProviders'"; |
358 |
|
328 |
$dbh->do(q{ |
359 |
$dbh->do(q{ |
329 |
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) |
360 |
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) |
330 |
VALUES |
361 |
VALUES |
Lines 332-337
return {
Link Here
|
332 |
('ERMProviderEbscoApiKey', '', '', 'API key for EBSCO', 'free'); |
363 |
('ERMProviderEbscoApiKey', '', '', 'API key for EBSCO', 'free'); |
333 |
}); |
364 |
}); |
334 |
|
365 |
|
335 |
|
366 |
say $out "Added new system preference 'ERMProviderEbscoCustomerID'"; |
|
|
367 |
say $out "Added new system preference 'ERMProviderEbscoApiKey'"; |
336 |
} |
368 |
} |
337 |
}; |
369 |
}; |