Bug 24476: Allow direct editing of autorenew_checkouts by patron
[srvgit] / installer / data / mysql / atomicupdate / bug_24476_opt_out_of_auto_renewal.perl
1 $DBversion = 'XXX';
2 if( CheckVersion( $DBversion ) ) {
3     unless( column_exists('borrowers','autorenew_checkouts') ){
4         $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" );
5     }
6     unless( column_exists('deletedborrowers','autorenew_checkouts') ){
7         $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1" );
8     }
9     $dbh->do(q{
10         INSERT INTO systempreferences
11         ( `variable`, `value`, `options`, `explanation`, `type` )
12         VALUES
13         ('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account tp choose whether their checkouts are auto renewed or not','YesNo')
14     });
15     SetVersion( $DBversion );
16     print "Upgrade to $DBversion done (Bug 24476 - Allow patrons to opt-out of autorenewal)\n";
17 }