123456789101112131415161718192021 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const TeaplanSchema = {
- trainplanid: { type: String, required: true, maxLength: 200 },
- nodate: { type: [ String ], required: false, maxLength: 200 },
- classid: { type: String, required: false, maxLength: 200 },
- headteacherid: { type: String, required: false, maxLength: 200 },
- };
- const schema = new Schema(TeaplanSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Teaplan', schema, 'teaplan');
- };
|