WIP: EE-port of internal id cleanup migration
What does this MR do?
Port of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20786.
This should only get merged with the bug fix for https://gitlab.com/gitlab-org/gitlab-ce/issues/49446.
The migration is meant to be used with gitlab-com/database#124 (closed).