mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix database upgrade
This commit is contained in:
1 parent
8621d55bb6
commit
8a8da0fba4
5 files changed
+5
-4
No files matched your search
@@ -1,4 +1,3 @@
|
|||||||
dist
|
dist
|
||||||
*.d.ts
|
*.d.ts
|
||||||
*.js
|
|
||||||
node_modules
|
node_modules
|
||||||
@@ -54,6 +54,8 @@ settings:
|
|||||||
import/parsers:
|
import/parsers:
|
||||||
'@typescript-eslint/parser':
|
'@typescript-eslint/parser':
|
||||||
- .ts
|
- .ts
|
||||||
|
- .js
|
||||||
|
- .jsx
|
||||||
import/resolver:
|
import/resolver:
|
||||||
typescript:
|
typescript:
|
||||||
alwaysTryTypes: true
|
alwaysTryTypes: true
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.21.3",
|
"version": "2.21.4",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export async function load(call: Entry) {
|
|||||||
const scripts = require('../upgrade');
|
const scripts = require('../upgrade');
|
||||||
let dbVer = (await modelSystem.get('db.ver')) ?? 0;
|
let dbVer = (await modelSystem.get('db.ver')) ?? 0;
|
||||||
const isFresh = !dbVer;
|
const isFresh = !dbVer;
|
||||||
const expected = scripts.length;
|
const expected = scripts.default.length;
|
||||||
while (dbVer < expected) {
|
while (dbVer < expected) {
|
||||||
logger.info('Upgrading database: from %d to %d', dbVer, expected);
|
logger.info('Upgrading database: from %d to %d', dbVer, expected);
|
||||||
if (isFresh) {
|
if (isFresh) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module.exports = {
|
|||||||
legacyDecorators: true,
|
legacyDecorators: true,
|
||||||
},
|
},
|
||||||
babelOptions: {
|
babelOptions: {
|
||||||
configFile: './babel.config.js',
|
configFile: `${__dirname}/babel.config.js`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
Reference in new issue
Block a user