Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Backup not working #1710

Open
baranowskinet opened this issue Dec 15, 2020 · 0 comments
Open

Restore Backup not working #1710

baranowskinet opened this issue Dec 15, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@baranowskinet
Copy link

DBFlow Version: 4.2.4

Bug Request:
When database is corrupted in way that integrity check returns not ok restore db doesn't work.

Description:
In DatabaseHelperDelegate.restoreBackup there is a bug related to get proper file names. Instead of X.getDatabaseName() inside FlowManager.getContext().getDatabasePath() there should be X.getDatabaseFileName()

also, I think temp database name should contains the same extention and code needs changes:

public static String getTempDbFileName(DatabaseDefinition databaseDefinition) {
    return TEMP_DB_NAME + databaseDefinition.getDatabaseName() + databaseDefinition.getDatabaseExtensionName();
}

and last thing. In restoreBackup system should close database before file copy. In other case after reopen there will be a problem with still opened corrupted db.

Kind regards, Krzysztof

@agrosner agrosner added the bug label Feb 21, 2021
@agrosner agrosner self-assigned this Feb 21, 2021
@agrosner agrosner added this to the 5.0.0-alpha2 milestone Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants