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

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

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

revision 148 by rakin, Mon Jul 29 17:28:47 2024 UTC revision 338 by rakin, Mon Jul 29 17:29:37 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 } from 'mongoose';
4    
5  class SpamViolation extends Model {}  export interface ISpamViolation {
6        user_id: string;
7        guild_id: string;
8        strike?: number;
9        createdAt: Date;
10    }
11    
12  SpamViolation.init({  const schema = new Schema({
     id: {  
         type: DataTypes.INTEGER,  
         autoIncrement: true,  
         primaryKey: true,  
     },  
13      user_id: {      user_id: {
14          type: DataTypes.STRING,          type: String,
15          allowNull: false          required: true
16      },      },
17      guild_id: {      guild_id: {
18          type: DataTypes.STRING,          type: String,
19          allowNull: false          required: true
20      },      },
21      strike: {      strike: {
22          type: DataTypes.INTEGER,          type: Number,
23          allowNull: false,          required: true,
24          defaultValue: 1          default: 1
25        },
26        createdAt: {
27            type: Date,
28            required: true
29      }      }
 }, {  
     sequelize: DiscordClient.client.db.sequelize,  
     modelName: 'SpamViolation',  
     updatedAt: false,  
     tableName: 'spam_violation'  
30  });  });
31    
 export default SpamViolation;  
32    export default model('SpamViolation', schema);

Legend:
Removed from v.148  
changed lines
  Added in v.338

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26