浏览代码

feat: 添加索引

zhangweicheng 4 年之前
父节点
当前提交
77911d6aec

+ 1 - 1
modules/all_models/proj_setting.js

@@ -6,7 +6,7 @@ let mongoose = require("mongoose");
 let Schema = mongoose.Schema;
 let collectionName = 'proj_setting';
 let projSettingSchema = {
-    projectID: Number,
+    projectID: {type: Number, index: true},
     // 列设置
     main_tree_col: {
         type: Schema.Types.Mixed,

+ 2 - 2
modules/all_models/quantity_detail.js

@@ -6,8 +6,8 @@ var mongoose = require('mongoose'),
     Schema = mongoose.Schema;
 
 var quantity_detail = new Schema({
-    ID:String,
-    projectID: Number,
+    ID:{type: String, index: true},
+    projectID: {type: Number, index: true},
     rationID:String,
     billID:String,
     name:String,

+ 1 - 1
modules/all_models/ration_coe.js

@@ -17,7 +17,7 @@ var coeSchema = mongoose.Schema({
 
 var coeListSchema = mongoose.Schema({
     libID: Number,                      // 所属定额库ID
-    ID: String,                         // 系数ID(流水号ID)
+    ID: {type: String, index: true},    // 系数ID(流水号ID)
     name: String,                       // 名称
     content: String,                    // 说明
     original_code:String,               //原人材机编码

+ 1 - 1
modules/all_models/ration_glj.js

@@ -13,7 +13,7 @@ var ration_glj = new Schema({
     repositoryId:Number,
     projectID: Number,
     rationID:{type: String, index: true},
-    projectGLJID:Number,
+    projectGLJID:{type: Number, index: true},
     name:String,
     code:String,
     //原始的编码

+ 3 - 3
modules/all_models/ration_installation.js

@@ -6,10 +6,10 @@ var mongoose = require('mongoose'),
     Schema = mongoose.Schema;
 
 var ration_installation = new Schema({
-    ID:String,
+    ID:{type: String, index: true},
     libID:Number,
-    projectID: Number,
-    rationID:String,
+    projectID: {type: Number, index: true},
+    rationID:{type: String, index: true},
     sectionId: String, //分册章节id
     feeItemId:String,
     ruleId:String,

+ 2 - 2
modules/all_models/ration_template.js

@@ -7,8 +7,8 @@ var mongoose = require('mongoose'),
 
 let ration_template =  new Schema({
     ID:String,
-    projectID: Number,
-    rationID:String,
+    projectID: {type: Number, index: true},
+    rationID:{type: String, index: true},
     createLocation:Number,//提取位置
     templateList:[new Schema({
         code:String,