Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Restore problem #389

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jamshidrostami
Copy link
Contributor

No description provided.

DB is changing by restoring a backup
Copy link
Owner

@DreierF DreierF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your PR!

Please see my comment

}
}
} catch (e: Exception) {
Timber.i(e, "DB has changed because of restoring a backup")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching generic exceptions without properly handling them is basically always a bad idea. I also don't understand yet how this would solve the restore problems.

Basically when you import a backup into the app the database contained in the backup is stored in the internal data of the app. Then the app restarts. If a database is detected that is currently being imported the previous database is replaced by the temporary copy (imported db). When the imported database is on an older version schema it has to be migrated to the newest schema (which happens automatically). Skipping the migration (as you did here) in case an error occurs just fixes the symptom of the app crashing, but not the underlying problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the version of backup DB is 25 and it tries to migrate to 26. but, Training table has already all columns!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants