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 7067-7072
if ( CheckVersion($DBversion) ) {
Link Here
|
7067 |
SetVersion($DBversion); |
7067 |
SetVersion($DBversion); |
7068 |
} |
7068 |
} |
7069 |
|
7069 |
|
|
|
7070 |
|
7071 |
|
7072 |
|
7073 |
|
7074 |
|
7075 |
|
7076 |
|
7077 |
$DBversion = "3.13.00.XXX"; |
7078 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
7079 |
|
7080 |
$dbh->do( q{ |
7081 |
ALTER TABLE letter ADD COLUMN message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email' AFTER content |
7082 |
} ); |
7083 |
|
7084 |
$dbh->do( q{ |
7085 |
ALTER TABLE letter ADD CONSTRAINT message_transport_type_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types(message_transport_type); |
7086 |
} ); |
7087 |
|
7088 |
$dbh->do( q{ |
7089 |
ALTER TABLE letter DROP PRIMARY KEY, ADD PRIMARY KEY (`module`,`code`,`branchcode`, message_transport_type); |
7090 |
} ); |
7091 |
|
7092 |
$dbh->do( q{ |
7093 |
CREATE TABLE overduerules_transport_types( |
7094 |
id INT(11) NOT NULL AUTO_INCREMENT, |
7095 |
branchcode varchar(10) NOT NULL DEFAULT '', |
7096 |
categorycode VARCHAR(10) NOT NULL DEFAULT '', |
7097 |
letternumber INT(1) NOT NULL DEFAULT 1, |
7098 |
message_transport_type VARCHAR(20) NOT NULL DEFAULT 'email', |
7099 |
PRIMARY KEY (id), |
7100 |
CONSTRAINT overduerules_fk FOREIGN KEY (branchcode, categorycode) REFERENCES overduerules (branchcode, categorycode) ON DELETE CASCADE ON UPDATE CASCADE, |
7101 |
CONSTRAINT mtt_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types (message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE |
7102 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
7103 |
} ); |
7104 |
|
7105 |
my $sth = $dbh->prepare( q{ |
7106 |
SELECT * FROM overduerules; |
7107 |
} ); |
7108 |
|
7109 |
$sth->execute; |
7110 |
my $sth_insert_mtt = $dbh->prepare( q{ |
7111 |
INSERT INTO overduerules_transport_types (branchcode, categorycode, letternumber, message_transport_type) VALUES ( ?, ?, ?, ? ) |
7112 |
} ); |
7113 |
while ( my $row = $sth->fetchrow_hashref ) { |
7114 |
my $branchcode = $row->{branchcode}; |
7115 |
my $categorycode = $row->{categorycode}; |
7116 |
for my $letternumber ( 1 .. 3 ) { |
7117 |
next unless $row->{"letter$letternumber"}; |
7118 |
$sth_insert_mtt->execute( |
7119 |
$branchcode, $categorycode, $letternumber, 'email' |
7120 |
); |
7121 |
} |
7122 |
} |
7123 |
|
7124 |
print "Upgrade done (Bug 9016: Adds the association table overduerules_transport_types)\n"; |
7125 |
SetVersion($DBversion); |
7126 |
} |
7127 |
|
7128 |
|
7070 |
=head1 FUNCTIONS |
7129 |
=head1 FUNCTIONS |
7071 |
|
7130 |
|
7072 |
=head2 TableExists($table) |
7131 |
=head2 TableExists($table) |
7073 |
- |
|
|