mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-28 11:53:11 -07:00
Merge pull request #1287 from ctrlaltca/servatrice_db_version
Fix misleading error message in servatrice; fix #1275
This commit is contained in:
@@ -69,10 +69,13 @@ bool Servatrice_DatabaseInterface::openDatabase()
|
||||
if (versionQuery->next()) {
|
||||
const int dbversion = versionQuery->value(0).toInt();
|
||||
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);
|
||||
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 {
|
||||
qCritical() << QString("[%1] Error opening database: unable to load database schema version (hint: ensure the cockatrice_schema_version contains a single record)").arg(poolStr);
|
||||
|
||||
Reference in New Issue
Block a user