Bug 29648: DBRev 21.12.00.038

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolin Somers 2022-04-27 10:46:14 -10:00
parent 33a2610b5b
commit af206b78bc
3 changed files with 9 additions and 17 deletions

View file

@ -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 = "21.12.00.037";
$VERSION = "21.12.00.038";
sub version {
return $VERSION;

View file

@ -1,14 +0,0 @@
use Modern::Perl;
return {
bug_number => "29648",
description => "Allow tables_settings.default_display_length to be NULL",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
ALTER TABLE tables_settings
MODIFY COLUMN default_display_length smallint(6) DEFAULT NULL
});
},
}

View file

@ -2,11 +2,16 @@ use Modern::Perl;
return {
bug_number => "29648",
description => "Move NumSavedReports to table settings",
description => "Move NumSavedReports to table settings and allow tables_settings.default_display_length to be NULL",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
ALTER TABLE tables_settings
MODIFY COLUMN default_display_length smallint(6) DEFAULT NULL
});
my $NumSavedReports = C4::Context->preference('NumSavedReports');
$dbh->do(q{
DELETE FROM systempreferences
@ -18,6 +23,7 @@ return {
INSERT IGNORE INTO tables_settings (module, page, tablename, default_display_length, default_sort_order)
VALUES('reports', 'saved-sql', 'table_reports', ?, 1)
}, undef, $NumSavedReports);
say $out "NumSavedReports value '$NumSavedReports' moved to table settings";
}
},
}
};