Sorry, I not familiar to Rails. I just wanna know how to apply add_index , after I've already done the migration file by db:migrate
add_index :categories_products,
[:category_id, :product_id], unique: true
I tried to edit the migrate and go db:migrate , it seems nothing happens.