migrate-hust: remove deprecated usage

This commit is contained in:
undefined committed 2021-09-05 20:37:06 +08:00
1 parent 37822f0025
commit fe340492b5
2 files changed
+5 -6

No files matched your search

+1 -2
View File
@@ -1,6 +1,5 @@
import { } from 'hydrooj'; import { md5, sha1 } from 'hydrooj/src/lib/crypto';
const { md5, sha1 } = global.Hydro.lib;
const RE_MD5 = /^[\da-fA-F]{32}$/; const RE_MD5 = /^[\da-fA-F]{32}$/;
function hash(password: string, stored: string) { function hash(password: string, stored: string) {
+4 -4
View File
@@ -1,10 +1,10 @@
/* eslint-disable no-tabs */ /* eslint-disable no-tabs */
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
import mysql from 'mysql'; import mysql from 'mysql';
import 'hydrooj';
import { buildContent } from 'hydrooj/src/lib/content'; import { buildContent } from 'hydrooj/src/lib/content';
import user from 'hydrooj/src/model/user';
const { user, problem, system } = global.Hydro.model; import problem from 'hydrooj/src/model/problem';
import * as system from 'hydrooj/src/model/system';
export async function run({ export async function run({
host = 'localhost', port = 27017, name = 'vijos4', username, password, host = 'localhost', port = 27017, name = 'vijos4', username, password,
@@ -93,7 +93,7 @@ export async function run({
samples: [[pdoc.sample_input, pdoc.sample_output]], samples: [[pdoc.sample_input, pdoc.sample_output]],
hint: pdoc.hint, hint: pdoc.hint,
source: pdoc.source, source: pdoc.source,
}, 'html'), }),
1, pdoc.source.split(' '), pdoc.defunct === 'Y', 1, pdoc.source.split(' '), pdoc.defunct === 'Y',
); );
const [cdoc] = await query(`SELECT * FROM 'privilege' WHERE rightstr = 'p${pdoc.problem_id}'`); const [cdoc] = await query(`SELECT * FROM 'privilege' WHERE rightstr = 'p${pdoc.problem_id}'`);