diff options
author | David Gay <david@davidgay.org> | 2021-07-05 20:30:15 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-05 20:30:15 -0400 |
commit | 28426519e11e72576b1a3339f47c420f9c184e49 (patch) | |
tree | ae92cce4888f8cbd038359902a6db6df557fe5cc /db/migrate | |
parent | f160f81a6daae8b478a5547078abc7c7b29ef747 (diff) |
Give characters a location, and replace the Locations view+controller with a Look view+controller
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20210706000053_add_location_to_character.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20210706000053_add_location_to_character.rb b/db/migrate/20210706000053_add_location_to_character.rb new file mode 100644 index 0000000..ec71ee8 --- /dev/null +++ b/db/migrate/20210706000053_add_location_to_character.rb @@ -0,0 +1,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 |