2016-06-09 12:39:16 +00:00
|
|
|
# rubocop:disable all
|
2013-04-25 14:15:33 +00:00
|
|
|
class AllowMergesForForks < ActiveRecord::Migration
|
|
|
|
def self.up
|
2013-08-23 09:34:08 +00:00
|
|
|
add_column :merge_requests, :target_project_id, :integer, :null => true
|
2016-03-28 22:03:29 +00:00
|
|
|
execute "UPDATE #{table_name} SET target_project_id = project_id"
|
2013-08-23 09:34:08 +00:00
|
|
|
change_column :merge_requests, :target_project_id, :integer, :null => false
|
2013-04-25 14:15:33 +00:00
|
|
|
rename_column :merge_requests, :project_id, :source_project_id
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
remove_column :merge_requests, :target_project_id
|
|
|
|
rename_column :merge_requests, :source_project_id,:project_id
|
|
|
|
end
|
2016-03-28 22:03:29 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def table_name
|
|
|
|
MergeRequest.table_name
|
|
|
|
end
|
2013-04-25 14:15:33 +00:00
|
|
|
end
|