Bugzilla – Attachment 98742 Details for
Bug 24640
quotes.timestamp should default to NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24640: Allow quotes.timestamp to be NULL
Bug-24640-Allow-quotestimestamp-to-be-NULL.patch (text/plain), 2.22 KB, created by
Jonathan Druart
on 2020-02-12 11:28:18 UTC
(
hide
)
Description:
Bug 24640: Allow quotes.timestamp to be NULL
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-12 11:28:18 UTC
Size:
2.22 KB
patch
obsolete
>From 20edd9c5f5321488349aafd92f8a0eba44e4e175 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Feb 2020 12:26:25 +0100 >Subject: [PATCH] Bug 24640: Allow quotes.timestamp to be NULL > >It is broken with strict mode enable, timestamp is created without >default value. > >Note that the .sql installer file init the value with NOW(), which is >wrong. > >DBD::mysql::st execute failed: Field 'timestamp' doesn't have a default >value [for Statement "INSERT INTO quotes (source, text) VALUES (?, ?);" >with ParamValues: 0="poeut", 1="pouet"] at >/kohadevbox/koha/tools/quotes/quotes_ajax.pl line 49. > >Test plan: >Create a new quote of the day >=> Without this patch you will get an error >--- > installer/data/mysql/atomicupdate/bug_24640.perl | 7 +++++++ > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 8 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_24640.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_24640.perl b/installer/data/mysql/atomicupdate/bug_24640.perl >new file mode 100644 >index 0000000000..393c049343 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24640.perl >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( "ALTER TABLE quotes MODIFY timestamp datetime NULL" ); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 24640 - Allow quotes.timestamp to be NULL)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 0aa3a9b784..36ba23d6e9 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3314,7 +3314,7 @@ CREATE TABLE `quotes` ( -- data for the quote of the day feature > `id` int(11) NOT NULL AUTO_INCREMENT, -- unique id for the quote > `source` MEDIUMTEXT DEFAULT NULL, -- source/credit for the quote > `text` LONGTEXT NOT NULL, -- text of the quote >- `timestamp` datetime NOT NULL, -- date and time that the quote last appeared in the opac >+ `timestamp` datetime NULL, -- date and time that the quote last appeared in the opac > PRIMARY KEY (`id`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24640
:
98742
|
99062
|
99063
|
99120