Lines 6396-6402
if ( CheckVersion($DBversion) ) {
Link Here
|
6396 |
$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');"); |
6396 |
$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');"); |
6397 |
$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');"); |
6397 |
$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');"); |
6398 |
print "Upgrade to $DBversion done (Add IDreamBooks enhanced content)\n"; |
6398 |
print "Upgrade to $DBversion done (Add IDreamBooks enhanced content)\n"; |
6399 |
SetVersion($DBversion); |
6399 |
SetVersion ($DBversion); |
6400 |
} |
6400 |
} |
6401 |
|
6401 |
|
6402 |
$DBversion = "3.11.00.018"; |
6402 |
$DBversion = "3.11.00.018"; |
Lines 7139-7144
if ( CheckVersion($DBversion) ) {
Link Here
|
7139 |
SetVersion ($DBversion); |
7139 |
SetVersion ($DBversion); |
7140 |
} |
7140 |
} |
7141 |
|
7141 |
|
|
|
7142 |
|
7143 |
|
7144 |
|
7145 |
|
7146 |
|
7147 |
|
7148 |
|
7149 |
$DBversion = "3.13.00.XXX"; |
7150 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
7151 |
|
7152 |
$dbh->do( q{ |
7153 |
ALTER TABLE letter ADD COLUMN message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email' AFTER content |
7154 |
} ); |
7155 |
|
7156 |
$dbh->do( q{ |
7157 |
ALTER TABLE letter ADD CONSTRAINT message_transport_type_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types(message_transport_type); |
7158 |
} ); |
7159 |
|
7160 |
$dbh->do( q{ |
7161 |
ALTER TABLE letter DROP PRIMARY KEY, ADD PRIMARY KEY (`module`,`code`,`branchcode`, message_transport_type); |
7162 |
} ); |
7163 |
|
7164 |
$dbh->do( q{ |
7165 |
CREATE TABLE overduerules_transport_types( |
7166 |
id INT(11) NOT NULL AUTO_INCREMENT, |
7167 |
branchcode varchar(10) NOT NULL DEFAULT '', |
7168 |
categorycode VARCHAR(10) NOT NULL DEFAULT '', |
7169 |
letternumber INT(1) NOT NULL DEFAULT 1, |
7170 |
message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email', |
7171 |
PRIMARY KEY (id), |
7172 |
CONSTRAINT overduerules_fk FOREIGN KEY (branchcode, categorycode) REFERENCES overduerules (branchcode, categorycode) ON DELETE CASCADE ON UPDATE CASCADE, |
7173 |
CONSTRAINT mtt_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types (message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE |
7174 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
7175 |
} ); |
7176 |
|
7177 |
my $sth = $dbh->prepare( q{ |
7178 |
SELECT * FROM overduerules; |
7179 |
} ); |
7180 |
|
7181 |
$sth->execute; |
7182 |
my $sth_insert_mtt = $dbh->prepare( q{ |
7183 |
INSERT INTO overduerules_transport_types (branchcode, categorycode, letternumber, message_transport_type) VALUES ( ?, ?, ?, ? ) |
7184 |
} ); |
7185 |
while ( my $row = $sth->fetchrow_hashref ) { |
7186 |
my $branchcode = $row->{branchcode}; |
7187 |
my $categorycode = $row->{categorycode}; |
7188 |
for my $letternumber ( 1 .. 3 ) { |
7189 |
next unless $row->{"letter$letternumber"}; |
7190 |
$sth_insert_mtt->execute( |
7191 |
$branchcode, $categorycode, $letternumber, 'email' |
7192 |
); |
7193 |
} |
7194 |
} |
7195 |
|
7196 |
print "Upgrade done (Bug 9016: Adds the association table overduerules_transport_types)\n"; |
7197 |
SetVersion($DBversion); |
7198 |
} |
7199 |
|
7200 |
|
7142 |
=head1 FUNCTIONS |
7201 |
=head1 FUNCTIONS |
7143 |
|
7202 |
|
7144 |
=head2 TableExists($table) |
7203 |
=head2 TableExists($table) |
7145 |
- |
|
|