mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Fix misleading error message in servatrice; fix #1275
This commit is contained in:
parent
0d5e169648
commit
946410de2b
1 changed files with 4 additions and 1 deletions
|
|
@ -69,10 +69,13 @@ bool Servatrice_DatabaseInterface::openDatabase()
|
||||||
if (versionQuery->next()) {
|
if (versionQuery->next()) {
|
||||||
const int dbversion = versionQuery->value(0).toInt();
|
const int dbversion = versionQuery->value(0).toInt();
|
||||||
const int expectedversion = DATABASE_SCHEMA_VERSION;
|
const int expectedversion = DATABASE_SCHEMA_VERSION;
|
||||||
if(dbversion != expectedversion)
|
if(dbversion < expectedversion)
|
||||||
{
|
{
|
||||||
qCritical() << QString("[%1] Error opening database: the database schema version is too old, you need to run the migrations to update it from version %2 to version %3").arg(poolStr).arg(dbversion).arg(expectedversion);
|
qCritical() << QString("[%1] Error opening database: the database schema version is too old, you need to run the migrations to update it from version %2 to version %3").arg(poolStr).arg(dbversion).arg(expectedversion);
|
||||||
return false;
|
return false;
|
||||||
|
} else if(dbversion > expectedversion) {
|
||||||
|
qCritical() << QString("[%1] Error opening database: the database schema version %2 is too new, you need to update servatrice (this servatrice actually uses version %3)").arg(poolStr).arg(dbversion).arg(expectedversion);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCritical() << QString("[%1] Error opening database: unable to load database schema version (hint: ensure the cockatrice_schema_version contains a single record)").arg(poolStr);
|
qCritical() << QString("[%1] Error opening database: unable to load database schema version (hint: ensure the cockatrice_schema_version contains a single record)").arg(poolStr);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue