Prepares confidential notes index
What does this MR do and why?
In an upcoming migration we will need to iterate through confidential notes in batches by ID, so we need an index on its ID.
Although there is already an index on confidential
column, this is not so useful for the upcoming migration -
related to !87908 (comment 975301306)
Screenshots or screen recordings
Migration output:
$ rake db:migrate
ci: == 20220608114734 PrepareConfidentialNoteIndexOnId: migrating =================
ci: -- index_exists?(:notes, :id, {:where=>"confidential = true", :name=>"index_notes_on_id_where_confidential", :algorithm=>:concurrently})
ci: -> 0.0071s
ci: -- add_index_options(:notes, :id, {:where=>"confidential = true", :name=>"index_notes_on_id_where_confidential", :algorithm=>:concurrently})
ci: -> 0.0002s
ci: == 20220608114734 PrepareConfidentialNoteIndexOnId: migrated (0.0112s) ========
$ rake db:rollback:main
main: == 20220608114734 PrepareConfidentialNoteIndexOnId: reverting =================
main: == 20220608114734 PrepareConfidentialNoteIndexOnId: reverted (0.0107s) ========
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jan Provaznik