2012-03-22 17:11:12 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-03-06 21:49:29 +00:00
|
|
|
class AddProjectToComment < ActiveRecord::Migration
|
|
|
|
def up
|
|
|
|
add_column :comments, :project_id, :integer
|
|
|
|
Subscribe.reset_column_information
|
|
|
|
Comment.where(:commentable_type => 'Grit::Commit').destroy_all
|
|
|
|
Comment.where(:commentable_type => 'Issue').each do |comment|
|
2012-08-15 14:52:32 +01:00
|
|
|
comment.update_column(:project_id, comment.commentable.project.id)
|
2012-03-06 21:49:29 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_column :comments, :project_id
|
|
|
|
end
|
|
|
|
end
|