class CreateAccountAuths < ActiveRecord::Migration[6.0] def change create_table :account_auths do |t| t.integer :user_id t.integer :account_id t.integer :role t.timestamps end rename_column :users, :role, :role_old rename_column :users, :account_id, :account_id_old change_column_null(:users, :role_old, true) change_column_null(:users, :account_id_old, true) end end