UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 866 B
'use strict';const exportexceltemplateSchema=new Schema({stt:Number,code:{type:String,uppercase:!0,required:!0,maxlength:32},title:{type:String,required:!0,maxlength:1024},file:String,id_company:String,handle_data:String,status:{type:Boolean,default:!0},date_created:{type:Date,default:Date.now},date_updated:{type:Date,default:Date.now},user_created:{type:String,default:""},user_updated:{type:String,default:""}}); (global.configs||{}).createIndexes&&(exportexceltemplateSchema.index({code:1}),exportexceltemplateSchema.index({id_company:1}),exportexceltemplateSchema.index({title:"text",code:"text"}),exportexceltemplateSchema.index({status:1}),exportexceltemplateSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.exportexceltemplate||mongoose.model("exportexceltemplate",exportexceltemplateSchema);module.exports=model;