Back up database before disabling downgrade
This commit is contained in:
parent
91940e11ad
commit
d1ef5431ac
2 changed files with 4 additions and 2 deletions
|
@ -803,7 +803,7 @@ Zotero.DBConnection.prototype.closeDatabase = function () {
|
|||
}
|
||||
|
||||
|
||||
Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
|
||||
Zotero.DBConnection.prototype.backupDatabase = function (suffix, force) {
|
||||
if (!suffix) {
|
||||
var numBackups = Zotero.Prefs.get("backup.numBackups");
|
||||
if (numBackups < 1) {
|
||||
|
@ -838,7 +838,7 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
|
|||
var file = Zotero.getZoteroDatabase(this._dbName);
|
||||
|
||||
// For standard backup, make sure last backup is old enough to replace
|
||||
if (!suffix) {
|
||||
if (!suffix && !force) {
|
||||
var backupFile = Zotero.getZoteroDatabase(this._dbName, 'bak');
|
||||
if (backupFile.exists()) {
|
||||
var currentDBTime = file.lastModifiedTime;
|
||||
|
|
|
@ -1398,7 +1398,9 @@ Zotero.Sync.Server = new function () {
|
|||
|
||||
// Enable
|
||||
if (index == 0) {
|
||||
Zotero.DB.backupDatabase(76, true);
|
||||
Zotero.DB.query("UPDATE version SET version=77 WHERE schema='userdata'");
|
||||
Zotero.wait(1000);
|
||||
}
|
||||
// Disable
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue