Skip to content
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

feat: create migration for old discount #6784

Merged
merged 3 commits into from
Feb 13, 2023

Conversation

vanpho93
Copy link
Member

@vanpho93 vanpho93 commented Feb 8, 2023

Resolves #6690
Impact: major
Type: feature

Issue

Old discount codes will not work in new promotion framework

Solution

Create migration for carts / discount codes to new promotions / coupons

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2023

⚠️ No Changeset found

Latest commit: f2a2321

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vanpho93 vanpho93 force-pushed the feat/create-migration-for-old-discount branch from d16e979 to c4d5dca Compare February 9, 2023 00:29
package.json Outdated Show resolved Hide resolved
* @param {String} entity - The entity (normally a collection) that you are tracking the ID for
* @return {Promise<Number>} - The auto-incrementing ID to use
*/
async function incrementSequence(db, shopId, entity) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a function defined in the code already for this, we should not duplicate it here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defined function is in another plugin, and we only have access to ({ db, progress }) so it's not easy to do.

packages/api-plugin-promotions-coupons/migrations/2.js Outdated Show resolved Hide resolved
Signed-off-by: vanpho93 <vanpho02@gmail.com>
Signed-off-by: vanpho93 <vanpho02@gmail.com>
@vanpho93 vanpho93 force-pushed the feat/create-migration-for-old-discount branch from 6edbcf2 to 919caa1 Compare February 9, 2023 09:12
Signed-off-by: vanpho93 <vanpho02@gmail.com>
@vanpho93 vanpho93 force-pushed the feat/create-migration-for-old-discount branch from 4c6814b to f2a2321 Compare February 13, 2023 07:07
@zenweasel zenweasel merged commit 93381c5 into feat/coupons Feb 13, 2023
@zenweasel zenweasel deleted the feat/create-migration-for-old-discount branch February 13, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants