|
Lines 24296-24496
unless ( $ENV{HTTP_HOST} ) { # Is that correct?
Link Here
|
| 24296 |
} |
24296 |
} |
| 24297 |
} |
24297 |
} |
| 24298 |
|
24298 |
|
| 24299 |
$DBversion = '21.06.00.001'; |
|
|
| 24300 |
if ( CheckVersion($DBversion) ) { |
| 24301 |
$dbh->do('DELETE FROM sessions'); |
| 24302 |
$dbh->do('ALTER TABLE sessions MODIFY a_session LONGBLOB NOT NULL'); |
| 24303 |
|
| 24304 |
NewVersion( $DBversion, '28489', 'Modify sessions.a_session from longtext to longblob' ); |
| 24305 |
} |
| 24306 |
|
| 24307 |
$DBversion = '21.06.00.002'; |
| 24308 |
if( CheckVersion( $DBversion ) ) { |
| 24309 |
if( !column_exists( 'borrower_modifications', 'relationship' ) ) { |
| 24310 |
$dbh->do(q{ |
| 24311 |
ALTER TABLE borrower_modifications ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER `borrowernotes` |
| 24312 |
}); |
| 24313 |
} |
| 24314 |
|
| 24315 |
if( !column_exists( 'borrowers', 'relationship' ) ) { |
| 24316 |
$dbh->do(q{ |
| 24317 |
ALTER TABLE borrowers ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor' AFTER `borrowernotes` |
| 24318 |
}); |
| 24319 |
} |
| 24320 |
|
| 24321 |
if( !column_exists( 'deletedborrowers', 'relationship' ) ) { |
| 24322 |
$dbh->do(q{ |
| 24323 |
ALTER TABLE deletedborrowers ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor' AFTER `borrowernotes` |
| 24324 |
}); |
| 24325 |
} |
| 24326 |
|
| 24327 |
NewVersion( $DBversion, 28490, "Bring back accidentally deleted relationship columns"); |
| 24328 |
} |
| 24329 |
|
| 24330 |
$DBversion = '21.06.00.003'; |
| 24331 |
if( CheckVersion( $DBversion ) ) { |
| 24332 |
|
| 24333 |
# Add 'WrongTransfer' to branchtransfers cancellation_reason enum |
| 24334 |
$dbh->do( |
| 24335 |
q{ |
| 24336 |
ALTER TABLE |
| 24337 |
`branchtransfers` |
| 24338 |
MODIFY COLUMN |
| 24339 |
`cancellation_reason` enum( |
| 24340 |
'Manual', |
| 24341 |
'StockrotationAdvance', |
| 24342 |
'StockrotationRepatriation', |
| 24343 |
'ReturnToHome', |
| 24344 |
'ReturnToHolding', |
| 24345 |
'RotatingCollection', |
| 24346 |
'Reserve', |
| 24347 |
'LostReserve', |
| 24348 |
'CancelReserve', |
| 24349 |
'ItemLost', |
| 24350 |
'WrongTransfer' |
| 24351 |
) |
| 24352 |
AFTER `comments` |
| 24353 |
} |
| 24354 |
); |
| 24355 |
|
| 24356 |
NewVersion( $DBversion, 24434, "Add 'WrongTransfer' to branchtransfers.cancellation_reason enum"); |
| 24357 |
} |
| 24358 |
|
| 24359 |
$DBversion = '21.06.00.004'; |
| 24360 |
if ( CheckVersion($DBversion) ) { |
| 24361 |
|
| 24362 |
$dbh->do(q{ |
| 24363 |
INSERT IGNORE permissions (module_bit, code, description) |
| 24364 |
VALUES |
| 24365 |
(4, 'delete_borrowers', 'Delete borrowers') |
| 24366 |
}); |
| 24367 |
|
| 24368 |
$dbh->do(q{ |
| 24369 |
INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) |
| 24370 |
SELECT borrowernumber, 4, 'delete_borrowers' FROM user_permissions WHERE code = 'edit_borrowers' |
| 24371 |
}); |
| 24372 |
|
| 24373 |
NewVersion( $DBversion, 15788, "Split edit_borrowers permission" ); |
| 24374 |
} |
| 24375 |
|
| 24376 |
$DBversion = '21.06.00.005'; |
| 24377 |
if( CheckVersion( $DBversion ) ) { |
| 24378 |
$dbh->do( q{ |
| 24379 |
INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) |
| 24380 |
VALUES ('NewsLog', '0', 'If enabled, log OPAC News changes', '', 'YesNo') |
| 24381 |
}); |
| 24382 |
|
| 24383 |
NewVersion( $DBversion, 26205, "Add new system preference NewsLog to log news changes"); |
| 24384 |
} |
| 24385 |
|
| 24386 |
$DBversion = '21.06.00.006'; |
| 24387 |
if( CheckVersion( $DBversion ) ){ |
| 24388 |
unless( column_exists( 'course_items', 'biblionumber') ) { |
| 24389 |
$dbh->do(q{ ALTER TABLE course_items ADD `biblionumber` int(11) AFTER `itemnumber` }); |
| 24390 |
|
| 24391 |
$dbh->do(q{ |
| 24392 |
UPDATE course_items |
| 24393 |
LEFT JOIN items ON items.itemnumber=course_items.itemnumber |
| 24394 |
SET course_items.biblionumber=items.biblionumber |
| 24395 |
WHERE items.itemnumber IS NOT NULL |
| 24396 |
}); |
| 24397 |
|
| 24398 |
$dbh->do(q{ ALTER TABLE course_items MODIFY COLUMN `biblionumber` INT(11) NOT NULL }); |
| 24399 |
|
| 24400 |
$dbh->do(q{ ALTER TABLE course_items ADD CONSTRAINT `fk_course_items_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE }); |
| 24401 |
$dbh->do(q{ ALTER TABLE course_items CHANGE `itemnumber` `itemnumber` int(11) DEFAULT NULL }); |
| 24402 |
} |
| 24403 |
|
| 24404 |
NewVersion( $DBversion, 14237, ["Add course_items.biblionumber column", "Add fk_course_items_biblionumber constraint", "Change course_items.itemnumber to allow NULL values"] ); |
| 24405 |
} |
| 24406 |
|
| 24407 |
$DBversion = '21.06.00.007'; |
| 24408 |
if( CheckVersion( $DBversion ) ) { |
| 24409 |
if( !column_exists( 'borrowers', 'primary_contact_method' ) ) { |
| 24410 |
$dbh->do( "ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" ); |
| 24411 |
} |
| 24412 |
|
| 24413 |
if( !column_exists( 'deletedborrowers', 'primary_contact_method' ) ) { |
| 24414 |
$dbh->do( "ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" ); |
| 24415 |
} |
| 24416 |
|
| 24417 |
if( !column_exists( 'borrower_modifications', 'primary_contact_method' ) ) { |
| 24418 |
$dbh->do( "ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `gdpr_proc_consent`" ); |
| 24419 |
} |
| 24420 |
|
| 24421 |
NewVersion( $DBversion, 11879, "Add a new field to patron record: main contact method"); |
| 24422 |
} |
| 24423 |
|
| 24424 |
$DBversion = '21.06.00.008'; |
| 24425 |
if( CheckVersion( $DBversion ) ) { |
| 24426 |
$dbh->do(q{ |
| 24427 |
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES |
| 24428 |
('ArticleRequestsOpacHostRedirection', '0', NULL, 'Enables redirection from child to host when requesting article on OPAC', 'YesNo') |
| 24429 |
}); |
| 24430 |
NewVersion( $DBversion, 20310, "Add pref ArticleRequestsOpacHostRedirection"); |
| 24431 |
} |
| 24432 |
|
| 24433 |
$DBversion = '21.06.00.009'; |
| 24434 |
if( CheckVersion( $DBversion ) ) { |
| 24435 |
unless ( column_exists('article_requests', 'format') ) { |
| 24436 |
$dbh->do(q| |
| 24437 |
ALTER TABLE article_requests |
| 24438 |
ADD COLUMN `format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY' AFTER notes |
| 24439 |
|); |
| 24440 |
} |
| 24441 |
unless ( column_exists('article_requests', 'urls') ) { |
| 24442 |
$dbh->do(q| |
| 24443 |
ALTER TABLE article_requests |
| 24444 |
ADD COLUMN `urls` MEDIUMTEXT AFTER format |
| 24445 |
|); |
| 24446 |
} |
| 24447 |
NewVersion( $DBversion, 20472, "Add columns format and urls in article_requests table"); |
| 24448 |
} |
| 24449 |
|
| 24450 |
$DBversion = '21.06.00.010'; |
| 24451 |
if( CheckVersion( $DBversion ) ) { |
| 24452 |
$dbh->do(q{ |
| 24453 |
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES |
| 24454 |
('ArticleRequestsSupportedFormats', 'PHOTOCOPY', 'PHOTOCOPY|SCAN', 'List supported formats between vertical bars', 'free') |
| 24455 |
}); |
| 24456 |
NewVersion( $DBversion, 20472, "Add syspref ArticleRequestsSupportedFormats"); |
| 24457 |
} |
| 24458 |
|
| 24459 |
$DBversion = '21.06.00.011'; |
| 24460 |
if( CheckVersion( $DBversion ) ) { |
| 24461 |
|
| 24462 |
my @fields = qw( |
| 24463 |
branchname |
| 24464 |
branchaddress1 |
| 24465 |
branchaddress2 |
| 24466 |
branchaddress3 |
| 24467 |
branchzip |
| 24468 |
branchcity |
| 24469 |
branchstate |
| 24470 |
branchcountry |
| 24471 |
branchphone |
| 24472 |
branchfax |
| 24473 |
branchemail |
| 24474 |
branchillemail |
| 24475 |
branchreplyto |
| 24476 |
branchreturnpath |
| 24477 |
branchurl |
| 24478 |
branchip |
| 24479 |
branchnotes |
| 24480 |
opac_info |
| 24481 |
marcorgcode |
| 24482 |
); |
| 24483 |
for my $f ( @fields ) { |
| 24484 |
$dbh->do(qq{ |
| 24485 |
UPDATE branches |
| 24486 |
SET $f = NULL |
| 24487 |
WHERE $f = "" |
| 24488 |
}); |
| 24489 |
} |
| 24490 |
|
| 24491 |
NewVersion( $DBversion, 28567, "Set to NULL empty branches fields"); |
| 24492 |
} |
| 24493 |
|
| 24494 |
# SEE bug 13068 |
24299 |
# SEE bug 13068 |
| 24495 |
# if there is anything in the atomicupdate, read and execute it. |
24300 |
# if there is anything in the atomicupdate, read and execute it. |
| 24496 |
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; |
24301 |
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; |
| 24497 |
- |
|
|