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

(-)a/installer/data/mysql/atomicupdate/bug_22155.perl (+20 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
4
    if ( column_exists( 'biblio_metadata', 'marcflavour' ) ) {
5
        $dbh->do(q{
6
            ALTER TABLE biblio_metadata
7
                CHANGE COLUMN marcflavour `schema` VARCHAR(16)
8
        });
9
    }
10
11
    if ( column_exists( 'deletedbiblio_metadata', 'marcflavour' ) ) {
12
        $dbh->do(q{
13
            ALTER TABLE deletedbiblio_metadata
14
                CHANGE COLUMN marcflavour `schema` VARCHAR(16)
15
        });
16
    }
17
18
    SetVersion( $DBversion );
19
    print "Upgrade to $DBversion done (Bug 22155 - biblio_metadata.marcflavour should be renamed 'schema')\n";
20
}
(-)a/installer/data/mysql/kohastructure.sql (-5 / +4 lines)
Lines 4007-4017 CREATE TABLE biblio_metadata ( Link Here
4007
    `id` INT(11) NOT NULL AUTO_INCREMENT,
4007
    `id` INT(11) NOT NULL AUTO_INCREMENT,
4008
    `biblionumber` INT(11) NOT NULL,
4008
    `biblionumber` INT(11) NOT NULL,
4009
    `format` VARCHAR(16) NOT NULL,
4009
    `format` VARCHAR(16) NOT NULL,
4010
    `marcflavour` VARCHAR(16) NOT NULL,
4010
    `schema` VARCHAR(16) NOT NULL,
4011
    `metadata` LONGTEXT NOT NULL,
4011
    `metadata` LONGTEXT NOT NULL,
4012
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
4012
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
4013
    PRIMARY KEY(id),
4013
    PRIMARY KEY(id),
4014
    UNIQUE KEY `biblio_metadata_uniq_key` (`biblionumber`,`format`,`marcflavour`),
4014
    UNIQUE KEY `biblio_metadata_uniq_key` (`biblionumber`,`format`,`schema`),
4015
    CONSTRAINT `record_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE,
4015
    CONSTRAINT `record_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE,
4016
    KEY `timestamp` (`timestamp`)
4016
    KEY `timestamp` (`timestamp`)
4017
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4017
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Lines 4025-4035 CREATE TABLE deletedbiblio_metadata ( Link Here
4025
    `id` INT(11) NOT NULL AUTO_INCREMENT,
4025
    `id` INT(11) NOT NULL AUTO_INCREMENT,
4026
    `biblionumber` INT(11) NOT NULL,
4026
    `biblionumber` INT(11) NOT NULL,
4027
    `format` VARCHAR(16) NOT NULL,
4027
    `format` VARCHAR(16) NOT NULL,
4028
    `marcflavour` VARCHAR(16) NOT NULL,
4028
    `schema` VARCHAR(16) NOT NULL,
4029
    `metadata` LONGTEXT NOT NULL,
4029
    `metadata` LONGTEXT NOT NULL,
4030
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
4030
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
4031
    PRIMARY KEY(id),
4031
    PRIMARY KEY(id),
4032
    UNIQUE KEY `deletedbiblio_metadata_uniq_key` (`biblionumber`,`format`,`marcflavour`),
4032
    UNIQUE KEY `deletedbiblio_metadata_uniq_key` (`biblionumber`,`format`,`schema`),
4033
    CONSTRAINT `deletedrecord_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES deletedbiblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE,
4033
    CONSTRAINT `deletedrecord_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES deletedbiblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE,
4034
    KEY `timestamp` (`timestamp`)
4034
    KEY `timestamp` (`timestamp`)
4035
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4035
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4036
- 

Return to bug 22155