mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-21 18:15:24 +00:00
remove back-compat with DB versions 0: fixes an annoying edge case where DB version isn't recorded on startup
This commit is contained in:
@ -22,20 +22,6 @@ static void dbCheck(lmdb::txn &txn, const std::string &cmd) {
|
|||||||
auto s = env.lookup_Meta(txn, 1);
|
auto s = env.lookup_Meta(txn, 1);
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
{
|
|
||||||
// The first version of the DB didn't use a Meta entry -- we consider this version 0
|
|
||||||
|
|
||||||
bool eventFound = false;
|
|
||||||
|
|
||||||
env.foreach_Event(txn, [&](auto &ev){
|
|
||||||
eventFound = true;
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (cmd == "export" || cmd == "info") return;
|
|
||||||
if (eventFound) dbTooOld(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
env.insert_Meta(txn, CURR_DB_VERSION, 1);
|
env.insert_Meta(txn, CURR_DB_VERSION, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user