Add index on enabled boolean

pull/9730/head
Oliver Günther 3 years ago
parent c874aad6df
commit a776dff0b4
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 15
      db/migrate/20211026061420_add_indexes_for_email_reminder_pause.rb

@ -0,0 +1,15 @@
require_relative './migration_utils/utils'
class AddIndexesForEmailReminderPause < ActiveRecord::Migration[6.1]
include ::Migration::Utils
def up
add_index :user_preferences,
"((user_preferences.settings->'pause_reminders'->>'enabled')::boolean)",
name: :index_user_prefs_settings_pause_reminders_enabled
end
def down
remove_index_if_exists :user_preferences, :index_user_prefs_settings_pause_reminders_enabled
end
end
Loading…
Cancel
Save