UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.59 kB
'use strict';const dmtoSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},ma_bp:{type:String,required:!0,uppercase:!0,maxlength:32,trim:!0},ten_bp:String,ma_doi:{type:String,required:!0,uppercase:!0,maxlength:32,trim:!0},ten_doi:String,ma_to:{type:String,required:!0,uppercase:!0,maxlength:32,trim:!0},ten_to:{type:String,required:!0,maxlength:1024},phu_trach:{type:String,uppercase:!0,maxlength:1024,trim:!0},phoi_hop:{type:String,uppercase:!0,maxlength:1024,trim:!0},exfields:Schema.Types.Mixed, visible_to:{type:Number,default:0},visible_to_users:[String],update_right:[String],delete_right:[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&&(dmtoSchema.index({id_app:1,ma_bp:1,ma_doi:1,ma_to:1},{unique:!0}),dmtoSchema.index({ten_to:1}),dmtoSchema.index({ten_bp:1}),dmtoSchema.index({ma_bp:"text",ten_bp:"text",ma_doi:"text",ten_doi:"text",ma_to:"text",ten_to:"text"},{name:"dmto_index_text"}),dmtoSchema.index({status:1}),dmtoSchema.index({user_created:1,visible_to:1,visible_to_users:1}),dmtoSchema.index({phu_trach:1}),dmtoSchema.index({phoi_hop:1})); const model=mongoose.models.dmto||mongoose.model("dmto",dmtoSchema);model.referenceKeys={ma_to:[{model:"phieudanhgia",key:"ma_to",error:"T\u1ed5 n\u00e0y \u0111\u00e3 ph\u00e1t sinh d\u1eef li\u1ec7u"},{model:"dmnv",key:"ma_to",error:"T\u1ed5 n\u00e0y \u0111\u00e3 ph\u00e1t sinh d\u1eef li\u1ec7u"}]};module.exports=model;