Sha256: 54b8805f8458a15c085d2df445d8b339abb95712ec7fd2a426bf6b5b8f372dd4

Contents?: true

Size: 260 Bytes

Versions: 9

Compression:

Stored size: 260 Bytes

Contents

class AddPriorityToVendor < SpreeExtension::Migration[4.2]
  def change
    add_column :spree_vendors, :priority, :integer
    Spree::Vendor.order(:updated_at).each.with_index(1) do |vendor, index|
      vendor.update_column :priority, index
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_multi_vendor-2.5.0 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.4.1 db/migrate/20190308091546_add_priority_to_vendor.rb
atkhayar-dev-spree-multi-vendor-0.0.0 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.4.0 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.3.0 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.2.0 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.1.0 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.0.2 db/migrate/20190308091546_add_priority_to_vendor.rb
spree_multi_vendor-2.0.1 db/migrate/20190308091546_add_priority_to_vendor.rb