1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

All: Fixed sync issue and database migration issue

This commit is contained in:
Laurent Cozic
2017-12-02 15:18:15 +00:00
parent dd615d6a8f
commit 1830ee9fd2
2 changed files with 7 additions and 5 deletions

View File

@@ -205,7 +205,9 @@ class JoplinDatabase extends Database {
const existingDatabaseVersions = [0, 1, 2, 3, 4, 5, 6, 7];
let currentVersionIndex = existingDatabaseVersions.indexOf(fromVersion);
if (currentVersionIndex == existingDatabaseVersions.length - 1) return false;
// currentVersionIndex < 0 if for the case where an old version of Joplin used with a newer
// version of the database, so that migration is not run in this case.
if (currentVersionIndex == existingDatabaseVersions.length - 1 || currentVersionIndex < 0) return false;
while (currentVersionIndex < existingDatabaseVersions.length - 1) {
const targetVersion = existingDatabaseVersions[currentVersionIndex + 1];