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

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

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

revision 59 by rakin, Mon Jul 29 17:28:25 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 Ballot extends Model {}  const schema = new Schema({
   
 Ballot.init({  
     // Model attributes are defined here  
     id: {  
         type: DataTypes.INTEGER,  
         autoIncrement: true,  
         primaryKey: true,  
     },  
4      content: {      content: {
5          type: DataTypes.STRING,          type: String,
6          allowNull: false          required: true
7      },      },
8      author: {      author: {
9          type: DataTypes.STRING,          type: String,
10          allowNull: true          required: true
11      },      },
12      msg_id: {      msg_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          allowNull: false          required: true
19      },      },
20      guild_id: {      guild_id: {
21          type: DataTypes.STRING,          type: String,
22          allowNull: false          required: true
23      },      },
24      date: {      date: {
25          type: DataTypes.DATE,          type: Date,
26          allowNull: false,          required: true,
27      }      }
 }, {  
     sequelize: DiscordClient.client.db.sequelize,  
     modelName: 'Ballot',  
     timestamps: false,  
28  });  });
29    
 export default Ballot;  
30    export default model('Ballot', schema);

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26