mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
添加站内消息,修复讨论节点丢失的问题
This commit is contained in:
1 parent
33e277f28f
commit
627e64a901
44 files changed
+582
-540
No files matched your search
+4
-3
@@ -10,7 +10,10 @@ async function run() {
|
||||
let mongourl = 'mongodb://';
|
||||
if (options.db.username) mongourl += `${options.db.username}:${options.db.password}@`;
|
||||
mongourl += `${options.db.host}:${options.db.port}/${options.db.name}`;
|
||||
const Database = await Mongo.MongoClient.connect(mongourl, { useNewUrlParser: true, useUnifiedTopology: true });
|
||||
const Database = await Mongo.MongoClient.connect(
|
||||
mongourl,
|
||||
{ useNewUrlParser: true, useUnifiedTopology: true },
|
||||
);
|
||||
const db = Database.db(options.db.name);
|
||||
const collUser = db.collection('user');
|
||||
const collRole = db.collection('role');
|
||||
@@ -48,8 +51,6 @@ async function run() {
|
||||
}, udoc),
|
||||
]);
|
||||
}
|
||||
await collUser.createIndex('unameLower', { unique: true });
|
||||
await collUser.createIndex('mailLower', { sparse: true });
|
||||
await collRole.insertMany(builtin.BUILTIN_ROLES);
|
||||
await collBlacklist.createIndex('expireAt', { expireAfterSeconds: 0 });
|
||||
await collToken.createIndex([{ uid: 1 }, { tokenType: 1 }, { updateAt: -1 }], { sparse: true });
|
||||
|
||||
Reference in new issue
Block a user