Table name "..." specified more than once with nested include all.
See original GitHub issueI’m using version 3.9.0 to interact with a PostgreSQL database.
It seems that with rather deep circular relationships include: [{all: true, nested: true}] fails with an error: table name "Some.Massive.Table.Chain.That.Actually.Cuts.Off.Somewh" specified more than once.
Because it cuts it off I’m actually not sure where it failed, but I have a (not really) good idea.
I have a model User, which has one UserAccount, which (and I’m paraphrasing this structure to not divulge too much company info) has many Item models, which has one Purchase model, which belongs to one UserTransaction model, which belongs to one PaymentMethod model, which belongs to the User model.
The Item and UserAccount BOTH have one Address model, which also belongs to an Event model, which belongs to an EventType model, which also belongs to the UserTransaction model.
It’s pretty convoluted, so I’m not sure where it fails. It cuts off on the UserTransaction model in the error message.
It may be that crazy circular dependencies like this cannot be done, but there should at least be a warning in the documentation for that.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)

Top Related StackOverflow Question
For hasMany associations you can check out
include.separate: true. But yeah that’s a mighty massive include. Long names being cut off is a known issue i’m afraid, we have not implemented a solution yet (not quite content with having to uglify table names).Thanks @mickhansen, I was having problems bringing in data that related to a bridge table, and the separete solved my problem by creating this query in a subquery.