From 745b79124345ecc05f1dbe81314ec23be99ff04c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 25 Mar 2019 19:04:37 +0000 Subject: [PATCH] Bug 22577: Add 'cron' system user --- installer/data/mysql/atomicupdate/bug_22577.perl | 9 +++++++++ installer/data/mysql/kohastructure.sql | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_22577.perl diff --git a/installer/data/mysql/atomicupdate/bug_22577.perl b/installer/data/mysql/atomicupdate/bug_22577.perl new file mode 100644 index 0000000000..b0510425a7 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22577.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE `borrowers` MODIFY COLUMN `branchcode` VARCHAR(10) DEFAULT NULL"); + $dbh->do( "ALTER TABLE `borrowers` MODIFY COLUMN `categorycode` VARCHAR(10) DEFAULT NULL"); + $dbh->do( "INSERT INTO `borrowers` (borrowernumber, surname, firstname, flags) VALUES ('-1', 'CRON', 'CRON', 0)" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 22577 - Add internal user for cron)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4769973ee8..c7c1f6b899 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1598,8 +1598,8 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons `B_email` MEDIUMTEXT, -- the patron/borrower's alternate email address `B_phone` LONGTEXT, -- the patron/borrower's alternate phone number `dateofbirth` date default NULL, -- the patron/borrower's date of birth (YYYY-MM-DD) - `branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table, includes the code of the patron/borrower's home branch - `categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category + `branchcode` varchar(10) default NULL, -- foreign key from the branches table, includes the code of the patron/borrower's home branch + `categorycode` varchar(10) default NULL, -- foreign key from the categories table, includes the code of the patron category `dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD) `dateexpiry` date default NULL, -- date the patron/borrower's card is set to expire (YYYY-MM-DD) `date_renewed` date default NULL, -- date the patron/borrower's card was last renewed -- 2.20.1