1 |
import { DataTypes, Model } from 'sequelize'; |
import { Schema, model, SchemaTypes, Document } from 'mongoose'; |
|
import DiscordClient from '../client/Client'; |
|
2 |
|
|
3 |
class Timeout extends Model {} |
const schema = new Schema({ |
|
|
|
|
Timeout.init({ |
|
|
// Model attributes are defined here |
|
|
id: { |
|
|
type: DataTypes.INTEGER, |
|
|
autoIncrement: true, |
|
|
primaryKey: true, |
|
|
}, |
|
4 |
time: { |
time: { |
5 |
type: DataTypes.STRING, |
type: String, |
6 |
allowNull: false |
required: true |
7 |
}, |
}, |
8 |
filePath: { |
filePath: { |
9 |
type: DataTypes.STRING, |
type: String, |
10 |
allowNull: false |
required: true |
11 |
}, |
}, |
12 |
params: { |
params: { |
13 |
type: DataTypes.STRING, |
type: String, |
14 |
allowNull: false |
required: true |
15 |
}, |
}, |
16 |
guild_id: { |
guild_id: { |
17 |
type: DataTypes.STRING, |
type: String, |
18 |
allowNull: false |
required: true |
19 |
}, |
}, |
20 |
cmd: { |
cmd: { |
21 |
type: DataTypes.STRING, |
type: String, |
22 |
allowNull: false, |
required: true, |
23 |
|
}, |
24 |
|
createdAt: { |
25 |
|
type: Date, |
26 |
|
required: true |
27 |
} |
} |
|
}, { |
|
|
sequelize: DiscordClient.client.db.sequelize, |
|
|
modelName: 'Timeout', |
|
|
createdAt: 'created_at', |
|
|
updatedAt: false |
|
28 |
}); |
}); |
29 |
|
|
|
export default Timeout; |
|
30 |
|
export default model('Timeout', schema); |