Sha256: f048055d148c5882030a7d1c94c96c979490e10137a860179745b06ffd3ca148

Contents?: true

Size: 323 Bytes

Versions: 17

Compression:

Stored size: 323 Bytes

Contents

class AddProjectIdToTasks < ActiveRecord::Migration
  def up
    add_column :tasks, :project_id, :integer
    execute "UPDATE tasks SET project_id=tickets.project_id FROM tickets WHERE ticket_id=tickets.id"
    change_column_null :tasks, :project_id, false
  end

  def down
    remove_column :tasks, :project_id
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
houston-core-0.8.0.pre db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.7.0 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.7.0.beta4 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.7.0.beta3 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.7.0.beta2 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.7.0.beta db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.6.3 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.6.2 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.6.1 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.6.0 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.6 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.5 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.4 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.3 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.2 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.1 db/migrate/20140824194031_add_project_id_to_tasks.rb
houston-core-0.5.0 db/migrate/20140824194031_add_project_id_to_tasks.rb