Sha256: eb087b59b3d7ab8d85fbbe6f7affb3576c8c6a9522c1d10ba44b35619b1d2c38
Contents?: true
Size: 786 Bytes
Versions: 120
Compression:
Stored size: 786 Bytes
Contents
class AddNumberToStockTransfer < ActiveRecord::Migration[4.2] def up remove_index :spree_stock_transfers, :source_location_id remove_index :spree_stock_transfers, :destination_location_id rename_column :spree_stock_transfers, :reference_number, :reference add_column :spree_stock_transfers, :number, :string Spree::StockTransfer.find_each do |transfer| transfer.send(:generate_stock_transfer_number) transfer.save! end add_index :spree_stock_transfers, :number add_index :spree_stock_transfers, :source_location_id add_index :spree_stock_transfers, :destination_location_id end def down rename_column :spree_stock_transfers, :reference, :reference_number remove_column :spree_stock_transfers, :number, :string end end
Version data entries
120 entries across 120 versions & 1 rubygems