Create the extra_property_definition_shop table in the 9.2.0 upgrade script - #1899
Open
jolelievre wants to merge 3 commits into
Open
Create the extra_property_definition_shop table in the 9.2.0 upgrade script#1899jolelievre wants to merge 3 commits into
jolelievre wants to merge 3 commits into
Conversation
Companion of PrestaShop/PrestaShop#42538: the registry now persists the resolved physical entity table (non-conventional naming support), so the upgrade DDL must create the column for shops upgrading to 9.2.0.
|
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.



Description
Companion to two core PRs touching the extra property registry schema for 9.2.0:
extra_property_definition_shopassociation table (created at install ininstall-dev/data/db_structure.sql).orders, Combination →product_attribute) by persisting the resolved physical table in a new nullabletable_namecolumn on theextra_property_definitionregistry.This PR adds the matching DDL to
upgrade/sql/9.2.0.sql: theextra_property_definition_shopCREATE TABLE IF NOT EXISTSright below theextra_property_definitionregistry table it references, and thetable_namecolumn in that registry table's definition — both with the same column definitions and keys as the install structure.No data seeding is needed: the absence of association rows is the shop feature's backward-compatible default ("no explicit restriction"), and a NULL
table_namefalls back to the entity name, which is correct for every definition created before #42538 (conventional naming was the only possibility).How to test
SHOW CREATE TABLE ps_extra_property_definition_shopreturns the table with the composite(id_extra_property_definition, id_shop)primary key and theid_shopkey, andSHOW COLUMNS FROM ps_extra_property_definition LIKE 'table_name'returns the nullable varchar(64) column — identical to a fresh install.CREATE TABLE IF NOT EXISTS).combinationentity storestable_name = product_attribute.