浏览代码

Teams/Organizations part 2, in progress. Table: org, add index for name field.

Thanks to xet7 !

Related #802
Lauri Ojansivu 5 年之前
父节点
当前提交
583f32e5c5
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      models/org.js

+ 7 - 0
models/org.js

@@ -118,4 +118,11 @@ Org.attachSchema(
   }),
 );
 
+if (Meteor.isServer) {
+  // Index for Organization name.
+  Meteor.startup(() => {
+    Org._collection._ensureIndex({ name: -1 });
+  });
+}
+
 export default Org;