Guard catalog pricing rule lookup during migrations#4309
Guard catalog pricing rule lookup during migrations#4309boboldehampsink wants to merge 5 commits into
Conversation
|
Added a second guard for the same migration-order path. After the catalog pricing rules table guard, the upgrade continued until product relation serialization hit |
|
Added another migration-order guard. The next failure was from |
|
Added a migration data-repair fix for The migration assumes every |
Summary
falsefromCatalogPricingRules::hasCatalogPricingRules()when the catalog pricing rules table has not been created yet.commerce_catalogpricingruleswhile Craft/Commerce migrations are still being applied.Context
During a Craft 5 / Commerce 5 upgrade, a Craft CMS migration can save single entries and serialize product relation fields before Commerce has applied
m221026_105212_add_catalog_pricing_table. That path callsProductQuery::beforePrepare(), which callshasCatalogPricingRules(), and currently attemptsexists()againstcommerce_catalogpricingruleseven when the table does not exist yet.Treating the missing table as “no catalog pricing rules yet” lets migrations continue until Commerce creates the table normally.