// database creation error!
}
- if (fileRecordCount >= 1 && isUpdateFrom_1_5) {
+ bool isUpdateFrom_1_8 = _journal->isUpdateFrom_1_8_0();
+
+ /*
+ * If 1.8.0 caused missing data in the local tree, this patch gets it
+ * back. For that, the usage of the journal for remote repository is
+ * disabled at the first start.
+ */
+ if (fileRecordCount >= 1 && (isUpdateFrom_1_5 || isUpdateFrom_1_8)) {
qDebug() << "detected update from 1.5" << fileRecordCount << isUpdateFrom_1_5;
// Disable the read from DB to be sure to re-read all the fileid and etags.
_csync_ctx->read_remote_from_db = false;
}
_possibleUpgradeFromMirall_1_5 = false;
+ _possibleUpgradeFromMirall_1_8_0 = false;
+
SqlQuery versionQuery("SELECT major, minor, patch FROM version;", _db);
if (!versionQuery.next()) {
// If there was no entry in the table, it means we are likely upgrading from 1.5
int minor = versionQuery.intValue(1);
int patch = versionQuery.intValue(2);
+ if( major == 1 && minor == 8 && patch == 0 ) {
+ _possibleUpgradeFromMirall_1_8_0 = true;
+ }
// Not comparing the BUILD id here, correct?
if( !(major == MIRALL_VERSION_MAJOR && minor == MIRALL_VERSION_MINOR && patch == MIRALL_VERSION_PATCH) ) {
createQuery.prepare("UPDATE version SET major=?1, minor=?2, patch =?3, custom=?4 "
_possibleUpgradeFromMirall_1_5 = false; // should be handled now
}
+ if (_possibleUpgradeFromMirall_1_8_0) {
+ _possibleUpgradeFromMirall_1_8_0 = false; // should be handled now
+ }
+
return true;
}
return _possibleUpgradeFromMirall_1_5;
}
+bool SyncJournalDb::isUpdateFrom_1_8_0()
+{
+ QMutexLocker lock(&_mutex);
+ checkConnect();
+ return _possibleUpgradeFromMirall_1_8_0;
+}
+
bool operator==(const SyncJournalDb::DownloadInfo & lhs,
const SyncJournalDb::DownloadInfo & rhs)
{
* are updated.
*/
bool isUpdateFrom_1_5();
+ bool isUpdateFrom_1_8_0();
private:
bool updateDatabaseStructure();
QMutex _mutex; // Public functions are protected with the mutex.
int _transaction;
bool _possibleUpgradeFromMirall_1_5;
+ bool _possibleUpgradeFromMirall_1_8_0;
QScopedPointer<SqlQuery> _getFileRecordQuery;
QScopedPointer<SqlQuery> _setFileRecordQuery;
QScopedPointer<SqlQuery> _getDownloadInfoQuery;