Rails 6.0 adds the ability to define multiple databases per environment, leading to a doubly-nested structure.
This needs to be handled properly in order for dbt to work with Rails projects of this sort.
The presence of a primary key at the second level is an indicator of this form being used. It's presumed that the primary must exist as Rails requires it.