blob: ec71ee81407345108f6dc69d2caa8217bfa595d5 (
plain)
1
2
3
4
5
6
7
8
9
|
class AddLocationToCharacter < ActiveRecord::Migration[6.1]
def change
add_reference :characters, :location, foreign_key: true
Character.all.each do |character|
character.update(location_id: Location.find_by_gid("floret").id)
end
change_column :characters, :location_id, :bigint, null: false
end
end
|