Rails add multiple columns after a specific column using sqlite3

32 Views Asked by At

I've generated Devise for User and now I want to add multiple columns after the email column:

class AddColumnsToUser < ActiveRecord::Migration[7.0]
  def change
    add_column :users, :name, :string, after: :email
    add_column :users, :surname, :string, after: :name
    add_column :users, :phone, :integer, after: :surname
    add_column :users, :favourites, :integer, after: :favourites
  end
end

but this code adding these columns at the end of table. I use sqlite3 as database in my app. Is it possible to do it in this configuration (rails 7 + sqlite3)?

0

There are 0 best solutions below