Bug 30185: Missing return in db rev 210600003.pl
[koha.git] / installer / data / mysql / db_revs / 210600039.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "28959",
5     description => "virtualshelves.category is really a boolean",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh) = @$args{qw(dbh)};
9
10         unless( column_exists( 'virtualshelves', 'public' ) ) {
11             # Add column
12             $dbh->do(q{
13                 ALTER TABLE virtualshelves
14                     ADD COLUMN `public` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'If the list is public'
15                     AFTER `owner`;
16             });
17             # Set public lists
18             $dbh->do(q{
19                 UPDATE virtualshelves
20                 SET public = 1
21                 WHERE category = 2;
22             });
23             # Drop old column
24             $dbh->do(q{
25                 ALTER TABLE virtualshelves
26                     DROP COLUMN `category`;
27             });
28         }
29     },
30 }