Answers for "rename migration file rails"

1

How can I rename a database column in a Ruby on Rails migration?

rails generate migration rename_title_to_name_in_tasks

class RenameTitleToNameInTasks < ActiveRecord::Migration[6.0]
  def change
    rename_column :tasks, :title, :name
  end
end
Posted by: Guest on December-10-2021

Code answers related to "rename migration file rails"

Browse Popular Code Answers by Language