Sha256: 603558af5e2716e852a83e04fc93f1a8993c8af6a212b138449d05cb5b11d07a

Contents?: true

Size: 395 Bytes

Versions: 1

Compression:

Stored size: 395 Bytes

Contents

class AllowTaskDescriptionsToBeNull < ActiveRecord::Migration
  def up
    change_column_null :tasks, :description, true
    Task.where(number: 1).update_all(description: nil)
  end
  
  def down
    Task.where(description: nil).includes(:ticket).find_each do |task|
      task.update_column :description, task.ticket.summary
    end
    change_column_null :tasks, :description, false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
houston-core-0.5.0.beta1 db/migrate/20140521014652_allow_task_descriptions_to_be_null.rb