summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-04 17:27:21 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-04 17:27:21 -0600
commita7f095d7171fe496c8037a451aaecfd234c30a01 (patch)
tree9c4115830ff339e48e8e6565908749de37eb21fa /db/migrate
parent283a368edd5d5c13aa8653156dd601505326864e (diff)
Añade índice entre productos, autores y reseñas
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20230404004859_add_index_spanning_users_and_reviews.rb5
1 files changed, 5 insertions, 0 deletions
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