Port of EE "Elasticsearch versioned schema for other ActiveRecord models"
This is the port from EE MR https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14522/
This is the port from EE MR https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14522/