2014-09-02 18:07:02 +05:30
|
|
|
class AllowMergesForForks < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
add_column :merge_requests, :target_project_id, :integer, :null => true
|
2016-06-02 11:05:42 +05:30
|
|
|
execute "UPDATE #{table_name} SET target_project_id = project_id"
|
2014-09-02 18:07:02 +05:30
|
|
|
change_column :merge_requests, :target_project_id, :integer, :null => false
|
|
|
|
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-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def table_name
|
|
|
|
MergeRequest.table_name
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|