From 35995e7be8e345d8f446a696aa0cd5ad8d372602 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sun, 14 Dec 2025 22:19:58 +0100 Subject: [PATCH] Add composite index to stats table if not exists --- db/migrate/20251208210410_add_composite_index_to_stats.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/migrate/20251208210410_add_composite_index_to_stats.rb b/db/migrate/20251208210410_add_composite_index_to_stats.rb index 7f82a326..581465fb 100644 --- a/db/migrate/20251208210410_add_composite_index_to_stats.rb +++ b/db/migrate/20251208210410_add_composite_index_to_stats.rb @@ -13,6 +13,7 @@ class AddCompositeIndexToStats < ActiveRecord::Migration[8.0] add_index :stats, %i[user_id year month], name: 'index_stats_on_user_id_year_month', unique: true, - algorithm: :concurrently + algorithm: :concurrently, + if_not_exists: true end end