Integrity constraint violation nightmare

If you search Google for "registry integrity constraint violation class drupal", you will get about 22.000 results of people talking about this fatal error. It only seems to happen if you're working in a multisite environment and are migrating databases a lot between localhost and test, but hey that's what we do all the time when working on big Drupal projects in a team! Thankfully, it is now marked as a critical issue for D7/8.