core: fix database upgrade

pull/92/head
undefined 4 years ago
parent 8621d55bb6
commit 8a8da0fba4

@ -1,4 +1,3 @@
dist
*.d.ts
*.js
node_modules

@ -54,6 +54,8 @@ settings:
import/parsers:
'@typescript-eslint/parser':
- .ts
- .js
- .jsx
import/resolver:
typescript:
alwaysTryTypes: true

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.21.3",
"version": "2.21.4",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",

@ -71,7 +71,7 @@ export async function load(call: Entry) {
const scripts = require('../upgrade');
let dbVer = (await modelSystem.get('db.ver')) ?? 0;
const isFresh = !dbVer;
const expected = scripts.length;
const expected = scripts.default.length;
while (dbVer < expected) {
logger.info('Upgrading database: from %d to %d', dbVer, expected);
if (isFresh) {

@ -22,7 +22,7 @@ module.exports = {
legacyDecorators: true,
},
babelOptions: {
configFile: './babel.config.js',
configFile: `${__dirname}/babel.config.js`,
},
},
settings: {

Loading…
Cancel
Save