Bug 21729: DBRev 21.12.00.010
[koha.git] / installer / data / mysql / db_revs / 211200002.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "13188",
5     description => "Allow configuration of required fields when a patron is editing their information via the OPAC",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9
10         $dbh->do(q{
11             INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
12             SELECT 'PatronSelfModificationMandatoryField', value, NULL, 'Define the required fields when a patron is editing their information via the OPAC','free'
13             FROM (SELECT value FROM systempreferences WHERE variable='PatronSelfRegistrationBorrowerMandatoryField') tmp
14         });
15
16         my ($syspref_value) = $dbh->selectrow_array(q{
17             SELECT value FROM systempreferences WHERE variable='PatronSelfModificationMandatoryField'
18         });
19         say $out "Added new system preference 'PatronSelfModificationMandatoryField' with value '$syspref_value'";
20     },
21   }