Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rename column in db rails

class RenameTitleToNameInTasks < ActiveRecord::Migration[6.0]
  def up
    rename_column :tasks, :title, :name
  end

  def down
    rename_column :tasks, :name, :title
  end
end
Source by www.codeandclay.com #
 
PREVIOUS NEXT
Tagged: #rename #column #db #rails
ADD COMMENT
Topic
Name
3+2 =