|
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 7155-7160
if ( CheckVersion($DBversion) ) {
Link Here
|
| 7155 |
SetVersion($DBversion); |
7155 |
SetVersion($DBversion); |
| 7156 |
} |
7156 |
} |
| 7157 |
|
7157 |
|
|
|
7158 |
|
| 7159 |
|
| 7160 |
|
| 7161 |
|
| 7162 |
|
| 7163 |
|
| 7164 |
|
| 7165 |
$DBversion = "3.13.00.XXX"; |
| 7166 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
| 7167 |
|
| 7168 |
$dbh->do( q{ |
| 7169 |
ALTER TABLE letter ADD COLUMN message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email' AFTER content |
| 7170 |
} ); |
| 7171 |
|
| 7172 |
$dbh->do( q{ |
| 7173 |
ALTER TABLE letter ADD CONSTRAINT message_transport_type_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types(message_transport_type); |
| 7174 |
} ); |
| 7175 |
|
| 7176 |
$dbh->do( q{ |
| 7177 |
ALTER TABLE letter DROP PRIMARY KEY, ADD PRIMARY KEY (`module`,`code`,`branchcode`, message_transport_type); |
| 7178 |
} ); |
| 7179 |
|
| 7180 |
$dbh->do( q{ |
| 7181 |
CREATE TABLE overduerules_transport_types( |
| 7182 |
id INT(11) NOT NULL AUTO_INCREMENT, |
| 7183 |
branchcode varchar(10) NOT NULL DEFAULT '', |
| 7184 |
categorycode VARCHAR(10) NOT NULL DEFAULT '', |
| 7185 |
letternumber INT(1) NOT NULL DEFAULT 1, |
| 7186 |
message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email', |
| 7187 |
PRIMARY KEY (id), |
| 7188 |
CONSTRAINT overduerules_fk FOREIGN KEY (branchcode, categorycode) REFERENCES overduerules (branchcode, categorycode) ON DELETE CASCADE ON UPDATE CASCADE, |
| 7189 |
CONSTRAINT mtt_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types (message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE |
| 7190 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 7191 |
} ); |
| 7192 |
|
| 7193 |
my $sth = $dbh->prepare( q{ |
| 7194 |
SELECT * FROM overduerules; |
| 7195 |
} ); |
| 7196 |
|
| 7197 |
$sth->execute; |
| 7198 |
my $sth_insert_mtt = $dbh->prepare( q{ |
| 7199 |
INSERT INTO overduerules_transport_types (branchcode, categorycode, letternumber, message_transport_type) VALUES ( ?, ?, ?, ? ) |
| 7200 |
} ); |
| 7201 |
while ( my $row = $sth->fetchrow_hashref ) { |
| 7202 |
my $branchcode = $row->{branchcode}; |
| 7203 |
my $categorycode = $row->{categorycode}; |
| 7204 |
for my $letternumber ( 1 .. 3 ) { |
| 7205 |
next unless $row->{"letter$letternumber"}; |
| 7206 |
$sth_insert_mtt->execute( |
| 7207 |
$branchcode, $categorycode, $letternumber, 'email' |
| 7208 |
); |
| 7209 |
} |
| 7210 |
} |
| 7211 |
|
| 7212 |
print "Upgrade done (Bug 9016: Adds the association table overduerules_transport_types)\n"; |
| 7213 |
SetVersion($DBversion); |
| 7214 |
} |
| 7215 |
|
| 7216 |
|
| 7158 |
=head1 FUNCTIONS |
7217 |
=head1 FUNCTIONS |
| 7159 |
|
7218 |
|
| 7160 |
=head2 TableExists($table) |
7219 |
=head2 TableExists($table) |
| 7161 |
- |
|
|