From 43a31d6b28bbe696aa7916af9286ff2f31205669 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Fri, 27 Jun 2008 14:07:57 -0500 Subject: [PATCH] bug 2274 [1/2] database changes (DB rev 907) to add email address to message_queue table I added two fields to the message_queue table: - to_address - from_address These can be used to override the default addresses used. By default, emails are sent to the borrowers.email address and sent from the KohaAdminEmailAddress syspref address. These values are still used if the to_address or from_address values are NULL. These changes are necessary to let overdue_notices.pl be backwards compatible. --- installer/data/mysql/kohastructure.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 11 +++++++++++ kohaversion.pl | 2 +- 3 files changed, 14 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f652e50..f8fc060 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2180,6 +2180,8 @@ DROP TABLE if EXISTS `message_queue`; CREATE TABLE `message_queue` ( `message_id` int(11) NOT NULL auto_increment, `borrowernumber` int(11) NOT NULL, + `to_address` mediumtext default NULL, + `from_address` mediumtext default NULL, `subject` text, `content` text, `message_transport_type` varchar(20) NOT NULL, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e008b6f..b025879 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1835,6 +1835,17 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (fix name borrower_message_preferences.wants_digest)\n"; SetVersion ($DBversion); } + +$DBversion = '3.00.00.097'; +if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) { + + $dbh->do('alter table message_queue add to_address mediumtext default NULL'); + $dbh->do('alter table message_queue add from_address mediumtext default NULL'); + + print "Upgrade to $DBversion done (adding email addresses to message_queue table)\n"; + SetVersion($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index a3b0213..71c822f 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = "3.00.00.096"; + our $VERSION = "3.00.00.097"; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 1.5.5.GIT