Sha256: 35ec18a3fd2ad5fbb19cc3ee75f46ac2b3c6ea35f6c0d3ca5bae2a0683a0332f
Contents?: true
Size: 445 Bytes
Versions: 18
Compression:
Stored size: 445 Bytes
Contents
class AddUuidToTickets < ActiveRecord::Migration def change add_column :tickets, :uuid, :string add_index :tickets, :uuid, :unique => true # # This is usually done in a rake task for speed, but local migrations can stand to do it inline # Ticket.unscoped.where(:uuid => nil).pluck(:id).each do |ticket_id| Ticket.unscoped.update_all({ :uuid => Ext::Uuid.uuid }, :id => ticket_id, :uuid => nil) end end end
Version data entries
18 entries across 18 versions & 1 rubygems