Add schema_version to all document types
Background
We recently introduced a schema_version field to the issue document types (users document type also has it). Adding it to the other document types will help do migrations in the future
Proposal
Add schema_version field to all document types. The format is Date.today.strftime('%y_%m'). The block should match the existing one for issues (including a comment):
# Schema version. The format is Date.today.strftime('%y_%m')
# Please update if you're changing the schema of the document
data['schema_version'] = 22_08
Steps to complete for each document type
- Create a new Elastic migration for each index to add the mapping
- Add the mapping to each index's
_configfile:indexes :schema_version, type: :short - Update each index's
_instance_proxyfile to determine the value ofschema_version, guarded by aElastic::DataMigrationService.migration_has_finished?check
Discussion thread
The following discussion from !96153 (merged) should be addressed:
-
@dgruzd started a discussion: (+1 comment) We might want to adopt similar approach for all document types. I think it would greatly simplify the migration process.
Edited by Terri Chu