/[sudobot]/trunk/src/models/ChannelLock.ts
ViewVC logotype

Diff of /trunk/src/models/ChannelLock.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 241 by rakin, Mon Jul 29 17:29:10 2024 UTC revision 332 by rakin, Mon Jul 29 17:29:35 2024 UTC
# Line 1  Line 1 
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, Document, SchemaTypes } from 'mongoose';
4    
5  class ChannelLock extends Model {}  const schema = new Schema({
   
 ChannelLock.init({  
     id: {  
         type: DataTypes.INTEGER,  
         autoIncrement: true,  
         primaryKey: true,  
     },  
6      reason: {      reason: {
7          type: DataTypes.TEXT,          type: String,
8          allowNull: true          required: false
9      },      },
10      user_id: {      user_id: {
11          type: DataTypes.STRING,          type: String,
12          allowNull: false          required: true
13      },      },
14      guild_id: {      guild_id: {
15          type: DataTypes.STRING,          type: String,
16            required: true
17      },      },
18      channel_id: {      channel_id: {
19          type: DataTypes.STRING,          type: String,
20          unique: true          unique: true,
21            required: true
22        },
23        role_id: {
24            type: String,
25            required: true
26      },      },
27      previous_perms: {      previous_perms: {
28          type: DataTypes.JSON,          allow: Array,
29          allowNull: false          deny: Array
30        },
31        createdAt: {
32            type: Date,
33            required: true
34      }      }
 }, {  
     sequelize: DiscordClient.client.db.sequelize,  
     modelName: 'ChannelLock',  
     updatedAt: false,  
     tableName: 'channel_lock'  
35  });  });
36    
 export default ChannelLock;  
37    export default model('ChannelLock', schema);

Legend:
Removed from v.241  
changed lines
  Added in v.332

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26