Browse Source

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

Thanks to xet7 !

Related #802
Lauri Ojansivu 5 years ago
parent
commit
583f32e5c5
1 changed files with 7 additions and 0 deletions
  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;
 export default Org;