View | Details | Raw Unified | Return to bug 28959
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_28959.pl (+30 lines)
Line 0 Link Here
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
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 5271-5277 CREATE TABLE `virtualshelves` ( Link Here
5271
  `shelfnumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier assigned by Koha',
5271
  `shelfnumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier assigned by Koha',
5272
  `shelfname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'name of the list',
5272
  `shelfname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'name of the list',
5273
  `owner` int(11) DEFAULT NULL COMMENT 'foreign key linking to the borrowers table (using borrowernumber) for the creator of this list (changed from varchar(80) to int)',
5273
  `owner` int(11) DEFAULT NULL COMMENT 'foreign key linking to the borrowers table (using borrowernumber) for the creator of this list (changed from varchar(80) to int)',
5274
  `category` varchar(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'type of list (private [1], public [2])',
5274
  `public` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'If the list is public',
5275
  `sortfield` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT 'title' COMMENT 'the field this list is sorted on',
5275
  `sortfield` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT 'title' COMMENT 'the field this list is sorted on',
5276
  `lastmodified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'date and time the list was last modified',
5276
  `lastmodified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'date and time the list was last modified',
5277
  `created_on` datetime NOT NULL COMMENT 'creation time',
5277
  `created_on` datetime NOT NULL COMMENT 'creation time',
5278
- 

Return to bug 28959