Perform vacuum if migration is performed

This commit is contained in:
emeric
2024-04-19 12:01:23 +02:00
parent 4432def11f
commit d6b86a9360
5 changed files with 33 additions and 17 deletions
+5 -1
View File
@@ -460,7 +460,7 @@ SELECT
session.getDboSession()->execute("DROP INDEX " + indexName);
}
void doDbMigration(Session& session)
bool doDbMigration(Session& session)
{
static const std::string outdatedMsg{ "Outdated database, please rebuild it (delete the .db file and restart)" };
@@ -496,6 +496,7 @@ SELECT
{56, migrateFromV56},
};
bool migrationPerformed{};
{
LMS_SCOPED_TRACE_OVERVIEW("Database", "Migration");
auto transaction{ session.createWriteTransaction() };
@@ -530,7 +531,10 @@ SELECT
VersionInfo::get(session).modify()->setVersion(++version);
LMS_LOG(DB, INFO, "Migration complete to version " << version);
migrationPerformed = true;
}
}
return migrationPerformed;
}
}