mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Change the version code to be the last run upgrade file.
This commit is contained in:
@@ -29,14 +29,12 @@ if (!config.readOnly) {
|
||||
let versionCodeInfo = db.prepare("SELECT value FROM config WHERE key = ?").get("version");
|
||||
let versionCode = versionCodeInfo ? versionCodeInfo.value : 0;
|
||||
|
||||
console.log(versionCode)
|
||||
|
||||
let path = config.schemaFolder + "/_upgrade_" + versionCode + ".sql";
|
||||
let path = config.schemaFolder + "/_upgrade_" + (versionCode + 1) + ".sql";
|
||||
while (fs.existsSync(path)) {
|
||||
db.exec(fs.readFileSync(path).toString());
|
||||
|
||||
versionCode = db.prepare("SELECT value FROM config WHERE key = ?").get("version").value;
|
||||
path = config.schemaFolder + "/_upgrade_" + versionCode + ".sql";
|
||||
path = config.schemaFolder + "/_upgrade_" + (versionCode + 1) + ".sql";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user