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
Put the data migration into its own migration file.
Matthew Kennedye95df3b78d3d
diff --git a/core/db/migrate/20210114220232_remove_store_id_from_spree_payment_methods.rb b/core/db/migrate/20210114220232_migrate_data_payment_methods_stores.rbsimilarity index 69%rename from core/db/migrate/20210114220232_remove_store_id_from_spree_payment_methods.rbrename to core/db/migrate/20210114220232_migrate_data_payment_methods_stores.rbindex 8d78236cb9..e231b4315d 100644--- a/core/db/migrate/20210114220232_remove_store_id_from_spree_payment_methods.rb+++ b/core/db/migrate/20210114220232_migrate_data_payment_methods_stores.rb@@ -1,4 +1,4 @@-class RemoveStoreIdFromSpreePaymentMethods < ActiveRecord::Migration[6.0]+class MigrateDataPaymentMethodsStores < ActiveRecord::Migration[6.0]def upSpree::PaymentMethod.all.each do |payment_method|next if payment_method.store_ids.any?@@ -12,8 +12,4 @@ class RemoveStoreIdFromSpreePaymentMethods < ActiveRecord::Migration[6.0]payment_method.saveendend-- def change- remove_column :spree_payment_methods, :store_id- endenddiff --git a/core/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rb b/core/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rbnew file mode 100644index 0000000000..abf407866a--- /dev/null+++ b/core/db/migrate/20210117112551_remove_store_id_from_spree_payment_methods.rb@@ -0,0 +1,5 @@+class RemoveStoreIdFromSpreePaymentMethods < ActiveRecord::Migration[6.0]+ def change+ remove_column :spree_payment_methods, :store_id, :integer+ end+end