Sha256: 08cea398bae28101eeef2cda26e7581abc5e9378c734e26c967c18702bf0267b
Contents?: true
Size: 799 Bytes
Versions: 21
Compression:
Stored size: 799 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.with_deleted.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
21 entries across 21 versions & 1 rubygems