Auto-generate stable fixture UUIDs on PostgreSQL

Fixes #11524. This PR builds on that one by @ruckc:
* Added tests.
* Supports polymorphic associations by inspecting the polymorphic foreign key type.