fix deprecated ActiveRecord query grammar and add .rb suffix for migration file