From: Mark Tompsett Date: Wed, 19 Jun 2019 16:28:44 +0000 (+0000) Subject: Bug 23151: Modifiy database structure X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=d102165f8de3b808e2f555df2c97e8864b5445aa Bug 23151: Modifiy database structure This modifies a fresh install structure, and provides an atomic update. Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- diff --git a/installer/data/mysql/atomicupdate/bug_23151.perl b/installer/data/mysql/atomicupdate/bug_23151.perl new file mode 100644 index 0000000..fc8a54b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23151.perl @@ -0,0 +1,13 @@ +use C4::Installer; + +my $DBVersion = 'XXX'; +if ( CheckVersion( $DBversion ) ) { + print "Running... "; + unless ( column_exists( 'borrower_modifications', 'changed_fields' ) ) { + print "Running... "; + $dbh->do("ALTER TABLE borrower_modifications ADD changed_fields MEDIUMTEXT AFTER verification_token;"); + } + print "Ran\n"; + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23151 - Add borrower_modifications.changed_fields column)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 2c7f361..62effe9 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3324,6 +3324,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 DEFAULT '', `borrowernumber` int(11) NOT NULL DEFAULT '0', `cardnumber` varchar(32) DEFAULT NULL, `surname` LONGTEXT,