Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

add indices to support finding notification recipients

ulferts57ed3c8fd3b2
diff --git a/db/migrate/20210915154656_add_user_preference_settings_indices.rb b/db/migrate/20210915154656_add_user_preference_settings_indices.rb
new file mode 100644
index 00000000000..fe288fd0d78
--- /dev/null
+++ b/db/migrate/20210915154656_add_user_preference_settings_indices.rb
@@ -0,0 +1,18 @@
+class AddUserPreferenceSettingsIndices < ActiveRecord::Migration[6.1]
+ def change
+ add_index :user_preferences,
+ "(settings->'daily_reminders'->'enabled')",
+ using: :gin,
+ name: 'index_user_prefs_settings_daily_reminders_enabled'
+
+ add_index :user_preferences,
+ "(settings->'daily_reminders'->'times')",
+ using: :gin,
+ name: 'index_user_prefs_settings_daily_reminders_times'
+
+ add_index :user_preferences,
+ "(settings->'time_zone')",
+ using: :gin,
+ name: 'index_user_prefs_settings_time_zone'
+ end
+end