Browse Source

Bug 23673: DBRev 19.12.00.019

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Martin Renvoize 3 years ago
parent
commit
21594689e5
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      Koha.pm
  2. 16
      Koha/Schema/Result/MessageQueue.pm
  3. 13
      installer/data/mysql/atomicupdate/bug-23673.perl
  4. 14
      installer/data/mysql/updatedatabase.pl

2
Koha.pm

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "19.12.00.018";
$VERSION = "19.12.00.019";
sub version {
return $VERSION;

16
Koha/Schema/Result/MessageQueue.pm

@ -72,6 +72,12 @@ __PACKAGE__->table("message_queue");
=head2 time_queued
data_type: 'timestamp'
datetime_undef_if_invalid: 1
is_nullable: 1
=head2 updated_on
data_type: 'timestamp'
datetime_undef_if_invalid: 1
default_value: current_timestamp
@ -117,6 +123,12 @@ __PACKAGE__->add_columns(
is_nullable => 0,
},
"time_queued",
{
data_type => "timestamp",
datetime_undef_if_invalid => 1,
is_nullable => 1,
},
"updated_on",
{
data_type => "timestamp",
datetime_undef_if_invalid => 1,
@ -181,8 +193,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9u39S/GLtZwnZGp+xcZOBA
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-05 14:26:34
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fSWIVVJGliKtqQaNbmZKYQ
sub koha_object_class {
'Koha::Notice::Message';

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

@ -1,13 +0,0 @@
$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");
$dbh->do("UPDATE message_queue SET updated_on=time_queued");
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 23673 - modify time_queued and add updated_on to message_queue)\n";
}

14
installer/data/mysql/updatedatabase.pl

@ -20732,6 +20732,20 @@ if( CheckVersion( $DBversion ) ) {
print "Upgrade to $DBversion done (Bug 18936: Convert issuingrules fields to circulation_rules)\n";
}
$DBversion = '19.12.00.019';
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");
$dbh->do("UPDATE message_queue SET updated_on=time_queued");
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 23673 - modify time_queued and add updated_on to message_queue)\n";
}
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';

Loading…
Cancel
Save