From a7f095d7171fe496c8037a451aaecfd234c30a01 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 4 Apr 2023 17:27:21 -0600 Subject: Añade índice entre productos, autores y reseñas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20230404004859_add_index_spanning_users_and_reviews.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20230404004859_add_index_spanning_users_and_reviews.rb (limited to 'db/migrate') diff --git a/db/migrate/20230404004859_add_index_spanning_users_and_reviews.rb b/db/migrate/20230404004859_add_index_spanning_users_and_reviews.rb new file mode 100644 index 0000000..3ca6728 --- /dev/null +++ b/db/migrate/20230404004859_add_index_spanning_users_and_reviews.rb @@ -0,0 +1,5 @@ +class AddIndexSpanningUsersAndReviews < ActiveRecord::Migration[7.0] + def change + add_index(:product_reviews, [:product_id, :user_account_id], unique: true) + end +end -- cgit v1.2.3