Bug 25086: Set changed_fields column as nullable

This patch changed_fields column as nullable.

To test:
1. Do not apply any patch
2. Set PatronSelfRegistrationVerifyByEmail preference to require
3. Fill self registration form in opac and submit
CHECK => OPAC dies with a nasty message, that says Field 'changed_fields' doesn't have a default value
4. Apply this patch and updatedatabase
5. Repeat step 3
SUCCESS => Registry process continues as expected
6. Sign off

Sponsored-by: Orex Digital
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Agustin Moyano 2020-04-08 16:53:43 -03:00 committed by Martin Renvoize
parent 081a4c75be
commit 039afd0936
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,9 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
# you can use $dbh here like:
$dbh->do( "ALTER TABLE borrower_modifications MODIFY changed_fields MEDIUMTEXT DEFAULT NULL" );
# Always end with this (adjust the bug info)
NewVersion( $DBversion, 25086, "Set changed_fields column of borrower_modifications as nullable");
}

View file

@ -3387,7 +3387,7 @@ CREATE TABLE borrower_attribute_types_branches( -- association table between bor
CREATE TABLE IF NOT EXISTS `borrower_modifications` (
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`verification_token` varchar(255) NOT NULL DEFAULT '',
`changed_fields` MEDIUMTEXT NOT NULL,
`changed_fields` MEDIUMTEXT DEFAULT NULL,
`borrowernumber` int(11) NOT NULL DEFAULT '0',
`cardnumber` varchar(32) DEFAULT NULL,
`surname` LONGTEXT,