grantcallendar/db/migrate/20220216133408_create_join_...

9 lines
200 B
Ruby

class CreateJoinTable < ActiveRecord::Migration[5.2]
def change
create_join_table :users, :roles do |t|
t.index [:user_id, :role_id]
# t.index [:role_id, :user_id]
end
end
end