|
5 years ago | |
---|---|---|
.. | ||
README.md | 7 years ago | |
column.js | 5 years ago | |
img.js | 5 years ago | |
menu.js | 5 years ago | |
modules.js | 5 years ago | |
news.js | 5 years ago | |
newslist.js | 5 years ago | |
site.js | 5 years ago |
'use strict';
const Schema = require('mongoose').Schema;
const SchemaDefine = {
code: { type: String, required: true, maxLength: 64 },
name: { type: String, required: true, maxLength: 128 },
order: Number,
};
const schema = new Schema(SchemaDefine);
schema.index({ code: 1 }, { unique: true });
module.exports = app => {
const { mongoose } = app;
return mongoose.model('CodeCategory', schema, 'naf_code_category');
};