From 683874a20e48534eee823a0faaa9b57ee1fd155d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 19 Aug 2016 16:47:25 -0300 Subject: [PATCH] Bug 16573: (RM followup) Update DBIx schema and prevent upgrade issues This patch updates the DBIx::Class schema files, and introduces the IGNORE option to the updatedatabase.pl's ALTER TABLE to prevent issues for users upgrading from 3.22 onwards. Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Virtualshelve.pm | 10 ++++------ installer/data/mysql/updatedatabase.pl | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Koha/Schema/Result/Virtualshelve.pm b/Koha/Schema/Result/Virtualshelve.pm index bd6c050..ba5fcf5 100644 --- a/Koha/Schema/Result/Virtualshelve.pm +++ b/Koha/Schema/Result/Virtualshelve.pm @@ -63,9 +63,8 @@ __PACKAGE__->table("virtualshelves"); =head2 created_on - data_type: 'timestamp' + data_type: 'datetime' datetime_undef_if_invalid: 1 - default_value: '0000-00-00 00:00:00' is_nullable: 0 =head2 allow_add @@ -113,9 +112,8 @@ __PACKAGE__->add_columns( }, "created_on", { - data_type => "timestamp", + data_type => "datetime", datetime_undef_if_invalid => 1, - default_value => "0000-00-00 00:00:00", is_nullable => 0, }, "allow_add", @@ -191,8 +189,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-11-05 10:39:28 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O3y89+0IUoePtcIHAqR+oA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-08-02 04:25:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FoBdYVoFQA19R1PMWqykYA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6697919..651b6e5 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12789,10 +12789,10 @@ if ( CheckVersion($DBversion) ) { $DBversion = '16.06.00.012'; if ( CheckVersion($DBversion) ) { $dbh->do(q{ - ALTER TABLE virtualshelves MODIFY COLUMN created_on DATETIME not NULL; + ALTER IGNORE TABLE virtualshelves MODIFY COLUMN created_on DATETIME not NULL; }); - print "Upgrade to $DBversion done (Bug 16573 - Web installer fails to load structure and sample data on MySQL 5.7)\n"; + print "Upgrade to $DBversion done (Bug 16573: Web installer fails to load structure and sample data on MySQL 5.7)\n"; SetVersion($DBversion); } -- 2.9.2