Fix updater
This commit is contained in:
parent
36c4e41131
commit
f44c9ce51b
|
@ -25,8 +25,10 @@ module.exports.checkVersion = function () {
|
||||||
}
|
}
|
||||||
var next = function () {
|
var next = function () {
|
||||||
hasUpdates.push(v);
|
hasUpdates.push(v);
|
||||||
|
Logger.syslog.log("Updated database to version " + v);
|
||||||
if (v < DB_VERSION) {
|
if (v < DB_VERSION) {
|
||||||
update(v++, next); } else {
|
update(v++, next);
|
||||||
|
} else {
|
||||||
db.query("UPDATE `meta` SET `value`=? WHERE `key`='db_version'",
|
db.query("UPDATE `meta` SET `value`=? WHERE `key`='db_version'",
|
||||||
[DB_VERSION]);
|
[DB_VERSION]);
|
||||||
}
|
}
|
||||||
|
@ -40,14 +42,15 @@ function update(version, cb) {
|
||||||
if (version < 3 && hasUpdates.indexOf(2) < 0) {
|
if (version < 3 && hasUpdates.indexOf(2) < 0) {
|
||||||
addMetaColumnToLibraries(cb);
|
addMetaColumnToLibraries(cb);
|
||||||
} else if (version < 4) {
|
} else if (version < 4) {
|
||||||
Q.all([
|
Q.allSettled([
|
||||||
Q.fcall(mergeChannelLibraries),
|
Q.nfcall(mergeChannelLibraries),
|
||||||
Q.fcall(mergeChannelRanks),
|
Q.nfcall(mergeChannelRanks),
|
||||||
Q.fcall(mergeChannelBans)
|
Q.nfcall(mergeChannelBans)
|
||||||
]).done(function () {
|
]).done(function () {
|
||||||
Logger.syslog.log("Merged channel tables. Please verify that everything " +
|
Logger.syslog.log("Merged channel tables. Please verify that everything " +
|
||||||
"is working correctly, and then type '/delete_old_tables'" +
|
"is working correctly, and then type '/delete_old_tables'" +
|
||||||
" into the CyTube process to remove the unused tables.");
|
" into the CyTube process to remove the unused tables.");
|
||||||
|
cb();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +114,7 @@ function mergeChannelLibraries(cb) {
|
||||||
if (err.stack) {
|
if (err.stack) {
|
||||||
Logger.errlog.log(err.stack);
|
Logger.errlog.log(err.stack);
|
||||||
}
|
}
|
||||||
}).done(cb);
|
}).done(function () { cb(null); });
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeChannelRanks(cb) {
|
function mergeChannelRanks(cb) {
|
||||||
|
@ -147,7 +150,7 @@ function mergeChannelRanks(cb) {
|
||||||
if (err.stack) {
|
if (err.stack) {
|
||||||
Logger.errlog.log(err.stack);
|
Logger.errlog.log(err.stack);
|
||||||
}
|
}
|
||||||
}).done(cb);
|
}).done(function () { cb(null); });
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeChannelBans(cb) {
|
function mergeChannelBans(cb) {
|
||||||
|
@ -183,7 +186,7 @@ function mergeChannelBans(cb) {
|
||||||
if (err.stack) {
|
if (err.stack) {
|
||||||
Logger.errlog.log(err.stack);
|
Logger.errlog.log(err.stack);
|
||||||
}
|
}
|
||||||
}).done(cb);
|
}).done(function () { cb(null); });
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.deleteOldChannelTables = function (cb) {
|
module.exports.deleteOldChannelTables = function (cb) {
|
||||||
|
|
Loading…
Reference in a new issue