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

(-)a/installer/data/mysql/atomicupdate/bug_38663.pl (+21 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "38663",
6
    description => "Add additional fields to libraries",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(q{ ALTER TABLE additional_field_values ADD COLUMN new_record_id VARCHAR(11) NOT NULL DEFAULT ''; });
12
13
        $dbh->do(q{ UPDATE additional_field_values SET new_record_id = CAST(record_id AS CHAR(11)); });
14
15
        $dbh->do(q{ ALTER TABLE additional_field_values DROP COLUMN record_id; });
16
17
        $dbh->do(q{ ALTER TABLE additional_field_values RENAME COLUMN new_record_id TO record_id; });
18
19
        say_success( $out, "Converted record_id to VARCHAR" );
20
    },
21
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 247-253 DROP TABLE IF EXISTS `additional_field_values`; Link Here
247
CREATE TABLE `additional_field_values` (
247
CREATE TABLE `additional_field_values` (
248
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier',
248
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier',
249
  `field_id` int(11) NOT NULL COMMENT 'foreign key references additional_fields(id)',
249
  `field_id` int(11) NOT NULL COMMENT 'foreign key references additional_fields(id)',
250
  `record_id` int(11) NOT NULL COMMENT 'record_id',
250
  `record_id` varchar(11) NOT NULL COMMENT 'record_id',
251
  `value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value for this field',
251
  `value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value for this field',
252
  PRIMARY KEY (`id`),
252
  PRIMARY KEY (`id`),
253
  KEY `afv_fk` (`field_id`),
253
  KEY `afv_fk` (`field_id`),
254
- 

Return to bug 38663