add column in rails in schema table after an existing column

class AddDobToCustomer < ActiveRecord::Migration[5.2]
  def change
    add_column :customers, :dob, :date, after: :email
  end
end


Comments

Popular posts from this blog

Rails 7 Features :: Comparison with Rails 6 and Rails 5