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

(-)a/installer/data/mysql/atomicupdate/bug_22155.perl (+22 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
4
    if ( ColumnExists( 'biblio_metadata', 'marcflavour' ) ) {
5
        print "Exists!";
6
        $dbh->do(q{
7
            ALTER TABLE biblio_metadata
8
                CHANGE COLUMN marcflavour `schema` VARCHAR(16)
9
        });
10
    }
11
12
    if ( ColumnExists( 'deletedbiblio_metadata', 'marcflavour' ) ) {
13
        print "Exists deelte";
14
        $dbh->do(q{
15
            ALTER TABLE deletedbiblio_metadata
16
                CHANGE COLUMN marcflavour `schema` VARCHAR(16)
17
        });
18
    }
19
20
    SetVersion( $DBversion );
21
    print "Upgrade to $DBversion done (Bug 22155 - biblio_metadata.marcflavour should be renamed 'schema')\n";
22
}
(-)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