You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
896 B
41 lines
896 B
3 years ago
|
const mongoose = require("mongoose");
|
||
|
|
||
|
const dbConnection = require("../config/config.js");
|
||
|
mongoose.connection = dbConnection;
|
||
|
// require clak module to give colors to console text.
|
||
|
var chalk = require("chalk");
|
||
|
|
||
|
// Define colors for db messages on cosole.
|
||
|
|
||
|
const Schema = mongoose.Schema;
|
||
|
|
||
|
const messageSchema = new mongoose.Schema(
|
||
|
{
|
||
|
body: String,
|
||
|
numSegments: String,
|
||
|
direction: String,
|
||
|
from: String,
|
||
|
to: String,
|
||
|
dateUpdated: Date,
|
||
|
price: String,
|
||
|
errorMessage: String,
|
||
|
uri: String,
|
||
|
accountSid: String,
|
||
|
numMedia: String,
|
||
|
status: String,
|
||
|
messagingServiceSid: String,
|
||
|
sid: String,
|
||
|
dateSent: Date,
|
||
|
dateCreated: Date,
|
||
|
errorCode: String,
|
||
|
priceUnit: String,
|
||
|
apiVersion: String,
|
||
|
subresourceUris: {
|
||
|
media: String,
|
||
|
},
|
||
|
},
|
||
|
{ versionKey: false }
|
||
|
);
|
||
|
|
||
|
module.exports = mongoose.model("Message", messageSchema);
|