trainplanyear.js 638 B

1234567891011121314151617181920
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 培训计划表
  5. const TrainplanyearSchema = {
  6. year: { type: String, required: true, maxLength: 200 }, // 年份
  7. title: { type: String, required: true, maxLength: 500 }, // 标题
  8. remark: { type: String, required: false }, // 备注
  9. };
  10. const schema = new Schema(TrainplanyearSchema, { toJSON: { virtuals: true } });
  11. schema.index({ id: 1 });
  12. schema.plugin(metaPlugin);
  13. module.exports = app => {
  14. const { mongoose } = app;
  15. return mongoose.model('Trainplanyear', schema, 'trainplan_year');
  16. };