mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Migrate supplier to variant
This commit is contained in:
11
db/migrate/20240422064305_migrate_product_supplier.rb
Normal file
11
db/migrate/20240422064305_migrate_product_supplier.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class MigrateProductSupplier < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
ActiveRecord::Base.connection.execute(<<-SQL
|
||||
UPDATE spree_variants
|
||||
SET supplier_id = spree_products.supplier_id
|
||||
FROM spree_products
|
||||
WHERE spree_variants.product_id = spree_products.id
|
||||
SQL
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user