You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
336 B
11 lines
336 B
5 years ago
|
class AddUserRefToRepository < ActiveRecord::Migration[5.2]
|
||
|
def change
|
||
|
add_column :repositories, :user_id, :integer
|
||
|
add_index :repositories, :user_id
|
||
|
|
||
|
Project.joins(:repository).find_each do |project|
|
||
|
project&.repository&.update_column(:user_id, project&.user_id) unless project&.repository.blank?
|
||
|
end
|
||
|
end
|
||
|
end
|