How to implement a unique index on two columns in rails December 23, 2022 by Tarik add_index :subscriptions, [:user_id, :content_id], unique: true