1 |
import { DataTypes, Model } from 'sequelize'; |
import { Schema, model } from 'mongoose'; |
|
import DiscordClient from '../client/Client'; |
|
2 |
|
|
3 |
class Punishment extends Model {} |
const schema = new Schema({ |
4 |
|
content: { |
5 |
Punishment.init({ |
type: String, |
6 |
id: { |
required: true |
7 |
type: DataTypes.INTEGER, |
}, |
8 |
primaryKey: true, |
author: { |
9 |
autoIncrement: true, |
type: String, |
10 |
allowNull: false, |
required: true, |
11 |
|
}, |
12 |
|
mod_tag: { |
13 |
|
type: String, |
14 |
|
required: true, |
15 |
}, |
}, |
16 |
user_id: { |
user_id: { |
17 |
type: DataTypes.STRING, |
type: String, |
18 |
allowNull: false, |
required: true |
|
}, |
|
|
mod_id: { |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
19 |
}, |
}, |
20 |
guild_id: { |
guild_id: { |
21 |
type: DataTypes.STRING, |
type: String, |
22 |
allowNull: false, |
required: true |
|
}, |
|
|
reason: { |
|
|
type: DataTypes.TEXT, |
|
|
allowNull: true |
|
|
}, |
|
|
type: { |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false |
|
|
}, |
|
|
meta: { |
|
|
type: DataTypes.JSON, |
|
|
allowNull: false, |
|
|
defaultValue: {} |
|
23 |
}, |
}, |
24 |
}, { |
createdAt: { |
25 |
sequelize: DiscordClient.client.db.sequelize, |
type: Date, |
26 |
modelName: 'Punishment', |
required: true |
27 |
updatedAt: false, |
} |
|
tableName: 'punishments' |
|
28 |
}); |
}); |
29 |
|
|
|
export default Punishment; |
|
30 |
|
export default model("Note", schema); |