-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove aldeed:schema-index Meteor package, use collectionIndex #5090
Conversation
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
It is no longer used by any core or included plugins. If used by custom plugins, add back the dependency or update the plugins to use `collectionIndex` function. Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, indexes are recreated (and some extras).
@@ -16,7 +16,7 @@ import { Metafield } from "./metafield"; | |||
* @property {String[]} relatedTagIds optional | |||
* @property {Boolean} isDeleted default value: `false` | |||
* @property {Boolean} isTopLevel required | |||
* @property {Boolean} isVisible defalut value: `true` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Spell Checker extension caught it, but I'll take credit. 😄
@@ -29,7 +29,6 @@ export default function defineCollections(db, collections) { | |||
ProductSearch: db.collection("ProductSearch"), | |||
roles: db.collection("roles"), | |||
SellerShops: db.collection("SellerShops"), | |||
Shipping: db.collection("Shipping"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this is just because we are creating Shipping
inside it's own package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
@@ -91,7 +82,7 @@ export const Discounts = new SimpleSchema({ | |||
}, | |||
"conditions.order.min": { | |||
type: Number, | |||
label: "Mininum", | |||
label: "Minimum", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Resolves #5080
Impact: minor
Type: feature
Changes
The
aldeed:schema-index
Meteor package takes SimpleSchema options likeindex: 1
andunique: true
and calls MongoDBcreateIndex
based on them. In an effort to reduce Meteor dependencies, all usage of this and thealdeed:schema-index
dependency itself has now been removed.Indexes are now set up by the plugins that care about them. They call
collectionIndex
in a startup function to do this. This may not be the final way this is done, but this PR is one step out of many to get to where we are going.The goal was not to make any decisions about the appropriateness of any indexes in this PR. I did notice some that seem to be outdated, but I did not remove them at this time. This is strictly an internal refactor.
There is one way in which this PR is more than a refactor. There were several fields in the Catalog schema that were marked to be indexed, but because that schema was not attached to the Catalog collection in Meteor, the indexes were not actually created. I did copy the useful ones to the new code, so now Catalog collection will have additional indexes created.
Breaking changes
If you have custom plugins that use
index
orunique
options in their schemas, add back thealdeed:schema-index
dependency or update the plugins to usecollectionIndex
function.Testing
develop
branch. Verify that your local database has indexes. Save off the list of indexes. For example: