1 |
import { DataTypes, Model } from 'sequelize'; |
import { DataTypes, Model } from 'sequelize'; |
2 |
import DiscordClient from '../client/Client'; |
import DiscordClient from '../client/Client'; |
3 |
|
import { Schema, model } from 'mongoose'; |
4 |
|
|
5 |
class Hardmute extends Model {} |
const schema = new Schema({ |
|
|
|
|
Hardmute.init({ |
|
|
id: { |
|
|
type: DataTypes.INTEGER, |
|
|
autoIncrement: true, |
|
|
primaryKey: true, |
|
|
}, |
|
6 |
user_id: { |
user_id: { |
7 |
type: DataTypes.STRING, |
type: String, |
8 |
allowNull: false |
required: true |
9 |
}, |
}, |
10 |
roles: { |
roles: { |
11 |
type: DataTypes.JSON, |
type: Array, |
12 |
allowNull: false |
required: true |
13 |
}, |
}, |
14 |
guild_id: { |
guild_id: { |
15 |
type: DataTypes.STRING, |
type: String, |
16 |
allowNull: false |
required: true |
17 |
|
}, |
18 |
|
createdAt: { |
19 |
|
type: Date, |
20 |
|
required: true |
21 |
} |
} |
|
}, { |
|
|
sequelize: DiscordClient.client.db.sequelize, |
|
|
modelName: 'Hardmute', |
|
|
updatedAt: false |
|
22 |
}); |
}); |
23 |
|
|
|
export default Hardmute; |
|
24 |
|
export default model('Hardmute', schema); |