Skip to content
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

postgresql - ignore cross-schema FKs #1313

Merged
merged 1 commit into from Oct 3, 2023
Merged

postgresql - ignore cross-schema FKs #1313

merged 1 commit into from Oct 3, 2023

Conversation

caleblloyd
Copy link
Contributor

@caleblloyd caleblloyd commented Oct 3, 2023

I've been using SQLBoiler for a few months and it has been working very well!

Recently I added another schema to my database with cross-schema FKs. Some of the table names referenced in the FKs are the same in each schema.

SQLBoiler is trying to make relationships for these cross-schema FKs. But since SQLBoiler doesn't generate cross-schema models, so it shouldn't consider cross-schema FKs.

This is a fairly simple fix that checks the destination column's table dstlookupname.relnamespace and makes sure it matches the pg_namespace.oid

Signed-off-by: Caleb Lloyd <caleblloyd@gmail.com>
@stephenafamo stephenafamo merged commit 644d45d into volatiletech:master Oct 3, 2023
2 checks passed
@caleblloyd caleblloyd deleted the psql-ignore-cross-schema-fk branch October 4, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants