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

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26