'use strict';

// scripts-model.js - A mongoose model
// 
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const scriptsSchema = new Schema({
  text: { type: String, required: true },
  createdAt: { type: Date, 'default': Date.now },
  updatedAt: { type: Date, 'default': Date.now }
});

const scriptsModel = mongoose.model('scripts', scriptsSchema);

module.exports = scriptsModel;
'use strict';

// scripts-model.js - A mongoose model
// 
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const scriptsSchema = new Schema({
  issue: { type: String, required: true },
  title: { type: String, required: true },
  text: { type: String, required: true },
  createdAt: { type: Date, 'default': Date.now },
  updatedAt: { type: Date, 'default': Date.now }
});

const scriptsModel = mongoose.model('scripts', scriptsSchema);

module.exports = scriptsModel;
Add script issue and title fields
Add script issue and title fields
