/[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 242 by rakin, Mon Jul 29 17:29:10 2024 UTC revision 344 by rakin, Mon Jul 29 17:29:40 2024 UTC
# Line 1  Line 1 
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);

Legend:
Removed from v.242  
changed lines
  Added in v.344

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26