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
Migrate all spree pref. keys to the new format #5660
Merged
sauloperez
merged 3 commits into
openfoodfoundation:master
from
coopdevs:fix-spree-preferences
Jun 23, 2020
Merged
Migrate all spree pref. keys to the new format #5660
sauloperez
merged 3 commits into
openfoodfoundation:master
from
coopdevs:fix-spree-preferences
Jun 23, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We realized in Spree v2.1 they follow this format instead and this is what's causing issues to Katuma production. This will remove the duplicate ones and convert the current preferences to the new thus, keeping the values.
sauloperez
force-pushed
the
fix-spree-preferences
branch
from
June 23, 2020 14:21
3ebb014
to
0ffa7b3
Compare
sauloperez
commented
Jun 23, 2020
@@ -0,0 +1,11 @@ | |||
class FixPreferencesKeys < ActiveRecord::Migration | |||
def up | |||
new_preferences = Spree::Preference.where("key like '/%'") |
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.
All keys that start with a slash got created today.
Matt-Yorkley
approved these changes
Jun 23, 2020
luisramos0
approved these changes
Jun 23, 2020
I have to share I am a bit concerned about the deletes. |
We only migrate preferences if there are any to migrate.
So all preferences are fetch from DB now that they have changed.
I added bit a of defensive coding as agreed on Slack plus the cache flush. |
sauloperez
added a commit
that referenced
this pull request
Jun 23, 2020
Migrate all spree pref. keys to the new format
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why?
Added by Luis:
Closes #5657
We realized in Spree v2.1 they follow this format instead and this is what's causing issues to Katuma production.
This will remove the duplicate ones and convert the current preferences to the new thus, keeping the values.
spree/spree#3905 is exactly what happened to us.
What should we test?
All instance configurations should contain the correct values after running the migration.
Release notes
Fix the spree preferences keys to conform to Spree's v2.1 format
Changelog Category: Fixed