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

(-)a/installer/data/mysql/atomicupdate/bug_28959.pl (+27 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
        # Add column
10
        $dbh->do(q{
11
            ALTER TABLE virtualshelves
12
                ADD COLUMN `public` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'If the list is public'
13
                AFTER `owner`;
14
        });
15
        # Set public lists
16
        $dbh->do(q{
17
            UPDATE virtualshelves
18
            SET public = 1
19
            WHERE category = 2;
20
        });
21
        # Drop old column
22
        $dbh->do(q{
23
            ALTER TABLE virtualshelves
24
                DROP COLUMN `category`;
25
        });
26
    },
27
}
(-)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