mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
Delete createTestDatabase.ts
This commit is contained in:
1 parent
fbd8796b8d
commit
37d7bb526c
1 file changed
-34
@@ -1,34 +0,0 @@
|
||||
import { Collection } from 'mongodb';
|
||||
import { Udoc } from '../interface';
|
||||
import * as db from '../service/db';
|
||||
import * as problem from '../model/problem';
|
||||
import { setPassword } from '../model/user';
|
||||
|
||||
export const description = 'Create A Test Database';
|
||||
|
||||
export async function run() {
|
||||
const collUser: Collection<Udoc> = db.collection('user');
|
||||
const collDocument = db.collection('document');
|
||||
await Promise.all([
|
||||
collUser.updateOne(
|
||||
{ _id: -1 },
|
||||
{
|
||||
priv: -1,
|
||||
uname: 'Root',
|
||||
unameLower: 'root',
|
||||
mail: 'root@hydro.local',
|
||||
mailLower: 'root@hydro.local',
|
||||
bio: 'Test Root User',
|
||||
regat: new Date(),
|
||||
loginat: new Date(),
|
||||
regip: '127.0.0.1',
|
||||
loginip: '127.0.0.1',
|
||||
},
|
||||
),
|
||||
]);
|
||||
await setPassword(-1, 'rootroot');
|
||||
}
|
||||
|
||||
export const validate = {};
|
||||
|
||||
global.Hydro.script.createTestDatabase = { run, description, validate };
|
||||
Reference in new issue
Block a user