Bug 25040: monkeypatch Schema::Loader for recent MariaDB
commit3dd79180f33bcdf810251638ae3984cbc832e024
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 3 Apr 2020 10:16:39 +0000 (3 11:16 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 Apr 2020 07:26:10 +0000 (14 08:26 +0100)
tree1749266ab63dd60d26e5c30bbf5740742562e0a1
parent9ac2ddda0b1506ea09a7c95a98926ea9e9c36bcf
Bug 25040: monkeypatch Schema::Loader for recent MariaDB

Recent versions of MariaDB changed the output of 'DESCRIBE' for
timestamp columns with defaults from `CURRENT_TIMESTAMP` to
`current_timestamp()`.  As such the code inside
DBIx::Class::Schema::Loader which catches such cases and outputs
`\"current_timestamp"` as a sensible cross platform default is missed
and this leads of inconsistent class files and bugs with out default
lookup code in Koha::Objects.

This patch serves as a backport of the code I have submitted upstream
such that out developers can continue to use update_dbix_class_files.pl
to build their schema classes from the database and regardless of their
db server version get a consistently correct output.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Schema/Loader/mysql.pm [new file with mode: 0644]
misc/devel/update_dbix_class_files.pl