1 |
import { DataTypes, Model } from 'sequelize'; |
import { Schema, model } from 'mongoose'; |
|
import DiscordClient from '../client/Client'; |
|
2 |
|
|
3 |
class ChannelLock extends Model {} |
const schema = new Schema({ |
|
|
|
|
ChannelLock.init({ |
|
|
id: { |
|
|
type: DataTypes.INTEGER, |
|
|
autoIncrement: true, |
|
|
primaryKey: true, |
|
|
}, |
|
4 |
reason: { |
reason: { |
5 |
type: DataTypes.TEXT, |
type: String, |
6 |
allowNull: true |
required: false |
7 |
}, |
}, |
8 |
user_id: { |
user_id: { |
9 |
type: DataTypes.STRING, |
type: String, |
10 |
allowNull: false |
required: true |
11 |
}, |
}, |
12 |
guild_id: { |
guild_id: { |
13 |
type: DataTypes.STRING, |
type: String, |
14 |
allowNull: false |
required: true |
15 |
}, |
}, |
16 |
channel_id: { |
channel_id: { |
17 |
type: DataTypes.STRING, |
type: String, |
18 |
unique: true, |
unique: true, |
19 |
allowNull: false |
required: true |
20 |
}, |
}, |
21 |
role_id: { |
role_id: { |
22 |
type: DataTypes.STRING, |
type: String, |
23 |
allowNull: false |
required: true |
24 |
}, |
}, |
25 |
previous_perms: { |
previous_perms: { |
26 |
type: DataTypes.JSON, |
allow: Array, |
27 |
allowNull: false |
deny: Array |
28 |
|
}, |
29 |
|
createdAt: { |
30 |
|
type: Date, |
31 |
|
required: true |
32 |
} |
} |
|
}, { |
|
|
sequelize: DiscordClient.client.db.sequelize, |
|
|
modelName: 'ChannelLock', |
|
|
updatedAt: false, |
|
|
tableName: 'channel_lock' |
|
33 |
}); |
}); |
34 |
|
|
|
export default ChannelLock; |
|
35 |
|
export default model('ChannelLock', schema); |