-
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
New data migration fulfillment #6633
New data migration fulfillment #6633
Conversation
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
|
Signed-off-by: Sujith <mail.sujithvn@gmail.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.
Just suggesting using regular operations rather than bulk operations
operations.push(ffTypeUpdate); | ||
operations.push(ffMethodUpdate); | ||
|
||
const bulkWriteResp = await db.collection(COLL_DEST).bulkWrite(operations); |
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.
This will probably work but it's not really what the bulkWrite API is really for an would probably be better as written as a single query. Bulkwrite is when you are doing a large amount of atomic operations, not one large one.
}); | ||
} | ||
if (permsToAdd.length) { | ||
permsToAdd.push("reaction:legacy:fulfillmentTypes/update:settings"); // add this setting to groups deailing with ff-types |
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.
typo in comment: dealing
…ction into 00-fulfillment-base Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Conflict res: pnpm-lock, preStartup Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Resolves #6472
Impact: breaking
Type: feature
This is replacement PR for #6544
Issue
Migrate data to the new format required for the new FFT plugins
Solution
We have 3 stages in a single migration;
Shipments
&FlatRateFulfillmentRestrictions
collections toFulfillment
&FulfillmentRestrictions
collections respectivelyFulfillment
collection with the newly introduced fields (fulfillmentType
&fulfillmentMethod
). Since the existing user base had only Shipping/Flatrate as the fulfillment type/method till date, we would be using those values to update collectionGroups
collection with the new permissionsBreaking changes
The 2nd stage above handles the breaking change where we would be using the possible existing values as the values or newly introduced fields.
Testing
In an existing installation, perform the data-migration. Update the installation to use the new version having fulfillment types. All activities in admin/shop (related to Products/Orders/FF-types/Catalogs/Carts) should continue to work without issues
To test migration steps, install api-migrations package and include the below entry in the
migrator.config.js
file.Run the command:
MONGO_URL=mongodb://localhost:27017/reaction npx migrator migrate