Lines 7166-7185
if ( CheckVersion($DBversion) ) {
Link Here
|
7166 |
fax varchar(100) default NULL, |
7166 |
fax varchar(100) default NULL, |
7167 |
email varchar(100) default NULL, |
7167 |
email varchar(100) default NULL, |
7168 |
notes mediumtext, |
7168 |
notes mediumtext, |
7169 |
rank SMALLINT default 0, |
7169 |
claimacquisition BOOLEAN NOT NULL DEFAULT 0, |
|
|
7170 |
claimissues BOOLEAN NOT NULL DEFAULT 0, |
7170 |
booksellerid int(11) not NULL, |
7171 |
booksellerid int(11) not NULL, |
7171 |
PRIMARY KEY (id), |
7172 |
PRIMARY KEY (id), |
7172 |
CONSTRAINT booksellerid_fk2 FOREIGN KEY (booksellerid) |
7173 |
CONSTRAINT booksellerid_fk2 FOREIGN KEY (booksellerid) |
7173 |
REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE |
7174 |
REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE |
7174 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"); |
7175 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"); |
7175 |
$dbh->do("INSERT INTO aqcontacts (name, position, phone, altphone, fax, |
7176 |
$dbh->do("INSERT INTO aqcontacts (name, position, phone, altphone, fax, |
7176 |
email, notes, booksellerid) |
7177 |
email, notes, booksellerid, acq_claim, serial_claim) |
7177 |
SELECT contact, contpos, contphone, contaltphone, contfax, contemail, |
7178 |
SELECT contact, contpos, contphone, contaltphone, contfax, contemail, |
7178 |
contnotes, id FROM aqbooksellers;"); |
7179 |
contnotes, id, 1, 1 FROM aqbooksellers;"); |
7179 |
$dbh->do("ALTER TABLE aqbooksellers DROP COLUMN contact, |
7180 |
$dbh->do("ALTER TABLE aqbooksellers DROP COLUMN contact, |
7180 |
DROP COLUMN contpos, DROP COLUMN contphone, |
7181 |
DROP COLUMN contpos, DROP COLUMN contphone, |
7181 |
DROP COLUMN contaltphone, DROP COLUMN contfax, |
7182 |
DROP COLUMN contaltphone, DROP COLUMN contfax, |
7182 |
DROP COLUMN contemail, DROP COLUMN contnotes;"); |
7183 |
DROP COLUMN contemail, DROP COLUMN contnotes;"); |
|
|
7184 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contact>>', '<<aqcontacts.name>>')"); |
7185 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contpos>>', '<<aqcontacts.position>>')"); |
7186 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contphone>>', '<<aqcontacts.phone>>')"); |
7187 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contaltphone>>', '<<aqcontacts.altphone>>')"); |
7188 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contfax>>', '<<aqcontacts.contfax>>')"); |
7189 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contemail>>', '<<aqcontacts.contemail>>')"); |
7190 |
$dbh->do("UPDATE letter SET content = replace(content, '<<aqbooksellers.contnotes>>', '<<aqcontacts.contnotes>>')"); |
7183 |
print "Upgrade to $DBversion done (Bug 10402: Move bookseller contacts to separate table)\n"; |
7191 |
print "Upgrade to $DBversion done (Bug 10402: Move bookseller contacts to separate table)\n"; |
7184 |
SetVersion($DBversion); |
7192 |
SetVersion($DBversion); |
7185 |
} |
7193 |
} |