This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.js
58 lines (51 loc) · 1.44 KB
/
db.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const mongoose = require('mongoose');
connectToDb().catch(err => console.error(err));
async function connectToDb() {
await mongoose.connect(process.env.MONGODB_CONN)
}
const User = mongoose.model('User', new mongoose.Schema({
UserId: String,
UserName: String,
Avatar: String,
InputMethod: String,
Language: String,
Version: String,
TitlesEnabled: Boolean,
VerseNumbersEnabled: Boolean,
PaginationEnabled: Boolean,
DisplayStyle: Boolean
}, { collection: 'Users' }))
const Guild = mongoose.model('Guild', new mongoose.Schema({
GuildId: String,
GuildName: String,
Language: String,
Version: String,
DisplayStyle: Boolean,
IgnoringBrackets: String,
DailyVerseChannelId: String,
DailyVerseWebhook: String,
DailyVerseTime: String,
DailyVerseTimeZone: String,
DailyVerseLastSentDate: String,
IsDM: Boolean
}, { collection: 'Guilds' }))
const Version = mongoose.model('Version', new mongoose.Schema({
Name: String,
Abbreviation: String,
Source: String,
SupportsOldTestament: Boolean,
SupportsNewTestament: Boolean,
SupportsDeuterocanon: Boolean
}, { collection: 'Versions' }))
const FrontendStat = mongoose.model('FrontendStat', new mongoose.Schema({
ShardCount: Number,
ServerCount: Number,
UserCount: Number,
ChannelCount: Number
}, { collection: 'FrontendStats' }))
module.exports = {
User,
Guild,
Version,
FrontendStat
}