Add schema_version to notes
What does this MR do and why?
This MR adds an integer field schema_version
in the notes
mapping. This field is useful in the case of reindexing all documents of notes
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Ensure Elasticsearch is enabled
- Run the following command and ensure the
mappings
in the response is empty
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-notes/_mapping/field/schema_version'
- Now open the rails console
bundle exec rails c
- Run the following command in the console
Elastic::DataMigrationService[20230824114205].send(:migration).migrate
- Now again run the curl command in the bash terminal and ensure the
mapping
in the response has the values. - Now edit or create any note(comment) and check that note in the elastic. Verify that the
schema_version
field is populated.
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.
Related to #372856 (closed)
Edited by Ravi Kumar