Browse Source

Bug 23673: Change DB Structure

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Agustin Moyano 5 years ago
committed by Martin Renvoize
parent
commit
76c0a06728
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 12
      installer/data/mysql/atomicupdate/bug-23673.perl
  2. 3
      installer/data/mysql/kohastructure.sql

12
installer/data/mysql/atomicupdate/bug-23673.perl

@ -0,0 +1,12 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do("ALTER TABLE message_queue MODIFY time_queued timestamp NULL");
if( !column_exists( 'message_queue', 'updated_on' ) ) {
$dbh->do("ALTER TABLE message_queue ADD COLUMN updated_on timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER time_queued");
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 23673 - modify time_queued and add updated_on to message_queue)\n";
}

3
installer/data/mysql/kohastructure.sql

@ -2387,7 +2387,8 @@ CREATE TABLE `message_queue` (
`letter_code` varchar(64) DEFAULT NULL,
`message_transport_type` varchar(20) NOT NULL,
`status` enum('sent','pending','failed','deleted') NOT NULL default 'pending',
`time_queued` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`time_queued` timestamp NULL,
`updated_on` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`to_address` LONGTEXT,
`from_address` LONGTEXT,
`content_type` MEDIUMTEXT,

Loading…
Cancel
Save