Remove class dependencies from migration

- rewrite the AddDbNameToServiceInstances migration to inline a method
  and redefine a class.
[#67082390]