Skip to content

Commit

Permalink
Merge pull request #356 from razee-io/remove_indexs
Browse files Browse the repository at this point in the history
remove ensureIndex
  • Loading branch information
dalehille authored Jul 31, 2020
2 parents 9b7f2ae + 757a268 commit e89f583
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 57 deletions.
5 changes: 0 additions & 5 deletions imports/api/cluster/clusters/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const Clusters = new Mongo.Collection('clusters');

Expand All @@ -24,7 +23,3 @@ Clusters.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
Clusters._ensureIndex({created:1});
}
5 changes: 0 additions & 5 deletions imports/api/deployables/channels/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const Channels = new Mongo.Collection('channels');

Expand All @@ -24,7 +23,3 @@ Channels.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
Channels._ensureIndex( { 'org_id': 1 } );
}
5 changes: 0 additions & 5 deletions imports/api/deployables/channels/deployableVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const DeployableVersions = new Mongo.Collection('deployableVersions');

Expand All @@ -24,7 +23,3 @@ DeployableVersions.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
DeployableVersions._ensureIndex( { 'org_id': 1} );
}
4 changes: 0 additions & 4 deletions imports/api/deployables/groups/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ Groups.deny({
update() { return true; },
remove() { return true; },
});

// if ( Meteor.isServer ) {
// Groups._ensureIndex( { 'org_id': 1, 'name': 1 } );
// }
5 changes: 0 additions & 5 deletions imports/api/deployables/subscriptions/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const Subscriptions = new Mongo.Collection('subscriptions');

Expand All @@ -24,7 +23,3 @@ Subscriptions.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
Subscriptions._ensureIndex( { 'org_id': 1 } );
}
5 changes: 0 additions & 5 deletions imports/api/externalApplications/externalApplications.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const ExternalApplications = new Mongo.Collection('externalApplications');

Expand All @@ -24,7 +23,3 @@ ExternalApplications.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
ExternalApplications._ensureIndex( { 'org_id': 'text' } );
}
19 changes: 1 addition & 18 deletions imports/api/resource/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,11 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const Resources = new Mongo.Collection('resources');

Resources.deny({
insert() { return true; },
update() { return true; },
remove() { return true; },
});

try {
if ( Meteor.isServer ) {
Resources._ensureIndex( {
'cluster_id': 'text',
'cluster_name': 'text',
'searchableData.name': 'text',
'searchableData.namespace': 'text',
'searchableData.kind': 'text',
'selfLink': 'text'
},
{name: 'cluster_id_text_searchableData.name_text_searchableData.namespace_text' } );
}
} catch (error) {
console.log(error);
}
});
5 changes: 0 additions & 5 deletions imports/api/resourceYamlHist/resourceYamlHist.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const ResourceYamlHist = new Mongo.Collection('resourceYamlHist');

Expand All @@ -24,7 +23,3 @@ ResourceYamlHist.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
ResourceYamlHist._ensureIndex( { org_id: 1, cluster_id: 1, resourceSelfLink: 1, updated: 1 } );
}
5 changes: 0 additions & 5 deletions imports/api/userLog/userLog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Colletion to hold all user log entries

import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

export const UserLog = new Mongo.Collection('user_log');

Expand All @@ -10,7 +9,3 @@ UserLog.deny({
update() { return true; },
remove() { return true; },
});

if ( Meteor.isServer ) {
UserLog._ensureIndex( { 'userid': 1, 'action': 1} );
}

0 comments on commit e89f583

Please sign in to comment.