Sha256: 74e1e4af00732c6271959177a2aee535dffc14aa28725f5f689493a7e0cc5bba

Contents?: true

Size: 370 Bytes

Versions: 3

Compression:

Stored size: 370 Bytes

Contents

class AddStoreIdToSpreeTrackers < ActiveRecord::Migration[6.0]
  def change
    add_column :spree_trackers, :store_id, :integer
    add_index :spree_trackers, :store_id

    Spree::Tracker.reset_column_information

    default_store = Spree::Store.default
    Spree::Tracker.all.each do |tracker|
      tracker.store = default_store
      tracker.save
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_analytics_trackers-2.1.1 db/migrate/20200721163729_add_store_id_to_spree_trackers.rb
spree_analytics_trackers-2.1.0 db/migrate/20200721163729_add_store_id_to_spree_trackers.rb
spree_analytics_trackers-2.0.0 db/migrate/20200721163729_add_store_id_to_spree_trackers.rb