Migrate combination image associations to carry their shop - #1889
Draft
boo-code wants to merge 1 commit into
Draft
Migrate combination image associations to carry their shop#1889boo-code wants to merge 1 commit into
boo-code wants to merge 1 commit into
Conversation
Collaborator
|
Hello @boo-code! This is your first pull request on autoupgrade repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
|
Author
|
Putting this on hold: the core change it migrates, PrestaShop/PrestaShop#42190, has been held for v10 - The migration itself is unchanged and verified; it will need moving to whichever upgrade file is current when the core side is picked up. |
This file contains hidden or 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
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.



Migration for PrestaShop/PrestaShop#42190, which gives
product_attribute_imagethe shop its association was made for so that choosing combination images in one shop stops discarding what the other shops chose (PrestaShop/PrestaShop#12638, PrestaShop/PrestaShop#39226).The new shape mirrors
product_carrier:PRIMARY KEY (id_product_attribute, id_image, id_shop).The order matters, because one existing row becomes one row per shop and the old two column key cannot hold them:
image_shop,Existing installs therefore keep exactly the selection they have today: an association becomes visible in the shops that already had the image, and in nothing else.
Verified against a copy of a real 9.2 database with a second shop added and half the images associated to it:
The
INSERT ... SELECTreads through a derived table so MySQL is not selecting from the table it inserts into.