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.

Update migration files to associate store.

Matthew Kennedy9434d2d03ff3
diff --git a/core/db/migrate/20210902110757_create_spree_wishlists.rb b/core/db/migrate/20210902110757_create_spree_wishlists.rb
index 66cce7a5b7..6750e278bf 100644
--- a/core/db/migrate/20210902110757_create_spree_wishlists.rb
+++ b/core/db/migrate/20210902110757_create_spree_wishlists.rb
@@ -1,7 +1,8 @@
class CreateSpreeWishlists < ActiveRecord::Migration[5.2]
def change
create_table :spree_wishlists, if_not_exists: true do |t|
- t.references :user
+ t.belongs_to :user
+ t.belongs_to :store
t.column :name, :string
t.column :token, :string
diff --git a/core/db/migrate/20210902123011_create_spree_wished_products.rb b/core/db/migrate/20210902123011_create_spree_wished_products.rb
index c4d627fe37..56fd96765e 100644
--- a/core/db/migrate/20210902123011_create_spree_wished_products.rb
+++ b/core/db/migrate/20210902123011_create_spree_wished_products.rb
@@ -2,7 +2,7 @@ class CreateSpreeWishedProducts < ActiveRecord::Migration[5.2]
def change
create_table :spree_wished_products, if_not_exists: true do |t|
t.references :variant
- t.references :wishlist
+ t.belongs_to :wishlist
t.column :quantity, :integer, default: 1, null: false
t.column :remark, :text
@@ -14,4 +14,3 @@ class CreateSpreeWishedProducts < ActiveRecord::Migration[5.2]
add_index :spree_wished_products, :wishlist_id unless index_exists?(:spree_wished_products, :wishlist_id)
end
end
-