class AddStartingHpToMonsterSpawns < ActiveRecord::Migration[6.1] def change add_column :monster_spawns, :starting_hp, :integer MonsterSpawn.all.each do |ms| ms.update(starting_hp: ms.monster.max_hp) end end end