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.

Add unique index on [:variant_id, :wishlist_id]

Matthew Kennedy5da084e2d186
diff --git a/core/db/migrate/20210902123011_create_spree_wished_products.rb b/core/db/migrate/20210902123011_create_spree_wished_products.rb
index 56fd96765e..04a9b4b46a 100644
--- a/core/db/migrate/20210902123011_create_spree_wished_products.rb
+++ b/core/db/migrate/20210902123011_create_spree_wished_products.rb
@@ -10,6 +10,7 @@ class CreateSpreeWishedProducts < ActiveRecord::Migration[5.2]
t.timestamps
end
+ add_index :spree_wished_products, [:variant_id, :wishlist_id], unique: true unless index_exists?(:spree_wished_products, [:variant_id, :wishlist_id])
add_index :spree_wished_products, :variant_id unless index_exists?(:spree_wished_products, :variant_id)
add_index :spree_wished_products, :wishlist_id unless index_exists?(:spree_wished_products, :wishlist_id)
end