mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 05:07:10 -05:00
fix another downgrade+upgrade bug
This commit is contained in:
parent
1cb2aa077a
commit
999c53b5ec
1 changed files with 4 additions and 1 deletions
|
|
@ -97,7 +97,10 @@ create table meta (dirMod int, lastUsn int); insert into meta values (0, 0);
|
||||||
# anew
|
# anew
|
||||||
self.col.log("failed to import old media db:"+traceback.format_exc())
|
self.col.log("failed to import old media db:"+traceback.format_exc())
|
||||||
self.db.execute("detach old")
|
self.db.execute("detach old")
|
||||||
os.rename("../collection.media.db", "../collection.media.db.old")
|
npath = "../collection.media.db.old"
|
||||||
|
if os.path.exists(npath):
|
||||||
|
os.unlink(npath)
|
||||||
|
os.rename("../collection.media.db", npath)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.col.server:
|
if self.col.server:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue