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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Skip unique name migrations in multi tenant environment (#12984)
Damian Legawiec57765c250877
diff --git a/core/db/migrate/20250730102644_add_missing_unique_indexes_to_spree_option_types_and_values.rb b/core/db/migrate/20250730102644_add_missing_unique_indexes_to_spree_option_types_and_values.rbindex bcc0af7191..61ee0d5bd9 100644--- a/core/db/migrate/20250730102644_add_missing_unique_indexes_to_spree_option_types_and_values.rb+++ b/core/db/migrate/20250730102644_add_missing_unique_indexes_to_spree_option_types_and_values.rb@@ -1,5 +1,8 @@class AddMissingUniqueIndexesToSpreeOptionTypesAndValues < ActiveRecord::Migration[7.2]def change+ # we don't need to run this migration in multi-tenant mode as it's already handled there+ return if defined?(SpreeMultiTenant)+# Rename duplicated option typesduplicates = Spree::OptionType.select(:name).group(:name).having('COUNT(*) > 1').reorder('').pluck(:name)diff --git a/core/db/migrate/20250730154601_add_unique_index_on_spree_properties_name.rb b/core/db/migrate/20250730154601_add_unique_index_on_spree_properties_name.rbindex af707a6010..442f6d3116 100644--- a/core/db/migrate/20250730154601_add_unique_index_on_spree_properties_name.rb+++ b/core/db/migrate/20250730154601_add_unique_index_on_spree_properties_name.rb@@ -1,5 +1,8 @@class AddUniqueIndexOnSpreePropertiesName < ActiveRecord::Migration[7.2]def change+ # we don't need to run this migration in multi-tenant mode as it's already handled there+ return if defined?(SpreeMultiTenant)+# Rename duplicated propertiesduplicates = Spree::Property.select(:name).group(:name).having('COUNT(*) > 1').reorder('').pluck(:name)