Browse Source

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

Thanks to xet7 !

Related #802
Lauri Ojansivu 6 năm trước cách đây
mục cha
commit
583f32e5c5
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  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;