Delete old journals when moving the database
This commit is contained in:
parent
0f991b434e
commit
8d0901a178
1 changed files with 4 additions and 1 deletions
|
@ -331,14 +331,17 @@ public class LockableDatabase {
|
|||
}
|
||||
|
||||
final StorageManager storageManager = getStorageManager();
|
||||
File oldDatabase = storageManager.getDatabase(uUid, oldProviderId);
|
||||
|
||||
// create new path
|
||||
prepareStorage(newProviderId);
|
||||
|
||||
// move all database files
|
||||
Utility.moveRecursive(storageManager.getDatabase(uUid, oldProviderId), storageManager.getDatabase(uUid, newProviderId));
|
||||
Utility.moveRecursive(oldDatabase, storageManager.getDatabase(uUid, newProviderId));
|
||||
// move all attachment files
|
||||
Utility.moveRecursive(storageManager.getAttachmentDirectory(uUid, oldProviderId), storageManager.getAttachmentDirectory(uUid, newProviderId));
|
||||
// remove any remaining old journal files
|
||||
deleteDatabase(oldDatabase);
|
||||
|
||||
mStorageProviderId = newProviderId;
|
||||
|
||||
|
|
Loading…
Reference in a new issue