Sha256: ef31ef1b98a08ce6ab7ec9175f2fb172aabe139fc859ad51ee5e5f7b55852025
Contents?: true
Size: 780 Bytes
Versions: 18
Compression:
Stored size: 780 Bytes
Contents
class AddNumberToStockTransfer < ActiveRecord::Migration 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.all.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
18 entries across 18 versions & 1 rubygems