Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Added store_id backfill task to 5.6 upgrade manifest

Damian Legawiecc1693fa3d27f
diff --git a/spree/core/lib/spree/upgrades/5_5_to_5_6/manifest.yml b/spree/core/lib/spree/upgrades/5_5_to_5_6/manifest.yml
index 44df0bb400..07d0744992 100644
--- a/spree/core/lib/spree/upgrades/5_5_to_5_6/manifest.yml
+++ b/spree/core/lib/spree/upgrades/5_5_to_5_6/manifest.yml
@@ -40,3 +40,20 @@ steps:
db:migrate. Records shared across stores keep one owner (promotions:
earliest then lowest store_id; payment methods: lowest store_id) unless
spree_multi_store is installed.
+
+ - id: taxon_store_id
+ name: "Backfill store_id on taxons"
+ task: "spree:taxons:backfill_store_id"
+ notes: |
+ Sets spree_taxons.store_id from each taxon's taxonomy, then resolves
+ taxonomy-less rows through their parent chain. Until this runs, existing
+ taxons keep resolving their store via the taxonomy join (Taxon.for_store
+ fallback); taxonomy-less categories (Spree::Category) rely on the direct
+ store_id, so the backfill is required for them.
+
+ - id: taxon_products_count
+ name: "Backfill products_count on taxons"
+ task: "spree:taxons:backfill_products_count"
+ notes: |
+ Recomputes the descendant-inclusive products_count counter cache on every
+ taxon in batches.