-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PGSync tries to find FK between unrelated tables. #142
Comments
There needs to be a direct or indirect relationship between all tables in your schemas. |
I've hyperlinked the schema source code in the issue description, or this link: https://gist.github.com/namoshizun/3f86d97cd0b4ce72b779ed913a4fa849 |
Sorry I meant the database schema itself. You can send this to me directly if you have any reservations. |
Bumping this, I'm experiencing the same issue. It seems to happen when you add children to a node that has a through_table property. For example this child seems to be using the through_table table of its parent instead of the table of its parent. I haven't been able to find exact reproduction steps, the initial bootstrap works, but at some point it breaks during a bulk update. This seems to be a duplicate of #199. |
I appear to be running into this as well. Initial bootstrap and sync work, but adding a new record on my Book<->Author through table errors with
Adding just a new Book works. Adding just a new Author works. It's adding a Book with an Author that is failing. The op causing it is
The last bit of the stack trace is
I'll try to dig into the code to see what it's expecting but would be happy to hear suggestions or workarounds. |
- When `through_tables` are explicitly specified, the table gets added to the tree when it shouldn't.
this fixed it for me: #332 |
Sorry for taking a while to address this. |
PGSync version:
v2.1.1
Postgres version:
v11.1
Elasticsearch version:
v7.11.2
Redis version:
v5
Python version:
v3.8
Problem Description:
Using this schema, while
bootstrap
andpgsync
commands run without issues, I am getting the following error when actually create aTenant
database record. Look like pgsync has mistakenly tried to correlate the UserRoles medium table with Role's foreign key entity District?Error Message (if any):
The text was updated successfully, but these errors were encountered: