mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Try to be slightly more tolerant of third-party tables in the DB
This commit is contained in:
parent
b38e26450e
commit
5dfd1f0cb3
@ -268,7 +268,8 @@ ServerDB::ServerDB() {
|
||||
qlForeignKeys << qsp(query.value(0).toString(), query.value(1).toString());
|
||||
|
||||
foreach(const qsp &key, qlForeignKeys) {
|
||||
ServerDB::exec(query, QString::fromLatin1("ALTER TABLE `%1` DROP FOREIGN KEY `%2`").arg(key.first).arg(key.second), true);
|
||||
if (key.first.startsWith(Meta::mp.qsDBPrefix))
|
||||
ServerDB::exec(query, QString::fromLatin1("ALTER TABLE `%1` DROP FOREIGN KEY `%2`").arg(key.first).arg(key.second), true);
|
||||
}
|
||||
|
||||
|
||||
@ -279,7 +280,8 @@ ServerDB::ServerDB() {
|
||||
qlIndexes << qsp(query.value(0).toString(), query.value(1).toString());
|
||||
|
||||
foreach(const qsp &key, qlIndexes) {
|
||||
ServerDB::exec(query, QString::fromLatin1("ALTER TABLE `%1` DROP INDEX `%2`").arg(key.first).arg(key.second), true);
|
||||
if (key.first.startsWith(Meta::mp.qsDBPrefix))
|
||||
ServerDB::exec(query, QString::fromLatin1("ALTER TABLE `%1` DROP INDEX `%2`").arg(key.first).arg(key.second), true);
|
||||
}
|
||||
|
||||
qlIndexes.clear();
|
||||
@ -291,7 +293,8 @@ ServerDB::ServerDB() {
|
||||
qlIndexes << qsp(query.value(0).toString(), query.value(1).toString());
|
||||
|
||||
foreach(const qsp &key, qlIndexes) {
|
||||
ServerDB::exec(query, QString::fromLatin1("ALTER TABLE `%1` DROP INDEX `%2`").arg(key.first).arg(key.second), true);
|
||||
if (key.first.startsWith(Meta::mp.qsDBPrefix))
|
||||
ServerDB::exec(query, QString::fromLatin1("ALTER TABLE `%1` DROP INDEX `%2`").arg(key.first).arg(key.second), true);
|
||||
}
|
||||
}
|
||||
SQLDO("CREATE TABLE `%1servers`(`server_id` INTEGER PRIMARY KEY AUTO_INCREMENT) Type=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user