UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.25 kB
'use strict';const dvcsSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},ma_dvcs:{type:String,uppercase:!0,maxlength:1024},ten_dvcs:{type:String,required:!0,maxlength:1024},exfields:Schema.Types.Mixed,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:""},visible_to:{type:Number,default:0},visible_to_users:[String],update_right:[String],delete_right:[String]}); (global.configs||{}).createIndexes&&(dvcsSchema.index({id_app:1,ma_dvcs:1},{unique:!0}),dvcsSchema.index({ten_dvcs:1}),dvcsSchema.index({ma_dvcs:"text",ten_dvcs:"text"}),dvcsSchema.index({status:1}),dvcsSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.dvcs||mongoose.model("dvcs",dvcsSchema); model.referenceKeys={_id:[{model:"sokho",key:"ma_dvcs",error:"\u0110\u01a1n v\u1ecb {{VALUE}} \u0111\u00e3 ph\u00e1t sinh d\u1eef li\u1ec7u"},{model:"cdvt",key:"ma_dvcs",error:"\u0110\u01a1n v\u1ecb {{VALUE}} \u0111\u00e3 ph\u00e1t sinh d\u1eef li\u1ec7u"},{model:"socai",key:"ma_dvcs",error:"\u0110\u01a1n v\u1ecb {{VALUE}} \u0111\u00e3 ph\u00e1t sinh d\u1eef li\u1ec7u"}]};module.exports=model;