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

(-)a/installer/data/mysql/atomicupdate/bug_35190.pl (+22 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35190",
5
    description => "Allow null values for authorized_value_category in additional_fields",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Set NULL as the default value
11
        $dbh->do(
12
            q{ALTER TABLE additional_fields MODIFY COLUMN authorised_value_category varchar(32) DEFAULT NULL COMMENT 'is an authorised value category'}
13
        );
14
15
        # Update any existing rows
16
        $dbh->do(q{UPDATE additional_fields SET authorised_value_category=NULL WHERE authorised_value_category=''});
17
18
        # tables
19
        say $out "Altered authorized_value_category in additional_fields to set NULL as the default value";
20
21
    },
22
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 260-266 CREATE TABLE `additional_fields` ( Link Here
260
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier',
260
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier',
261
  `tablename` varchar(255) NOT NULL DEFAULT '' COMMENT 'tablename of the new field',
261
  `tablename` varchar(255) NOT NULL DEFAULT '' COMMENT 'tablename of the new field',
262
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name of the field',
262
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name of the field',
263
  `authorised_value_category` varchar(32) NOT NULL DEFAULT '' COMMENT 'is an authorised value category',
263
  `authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'is an authorised value category',
264
  `marcfield` varchar(16) NOT NULL DEFAULT '' COMMENT 'contains the marc field to copied into the record',
264
  `marcfield` varchar(16) NOT NULL DEFAULT '' COMMENT 'contains the marc field to copied into the record',
265
  `marcfield_mode` enum('get','set') NOT NULL DEFAULT 'get' COMMENT 'mode of operation (get or set) for marcfield',
265
  `marcfield_mode` enum('get','set') NOT NULL DEFAULT 'get' COMMENT 'mode of operation (get or set) for marcfield',
266
  `searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is the field searchable?',
266
  `searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is the field searchable?',
267
- 

Return to bug 35190