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

ambiguous error while join two table with soft delete #26

Open
farshadfahimi opened this issue Aug 21, 2021 · 3 comments
Open

ambiguous error while join two table with soft delete #26

farshadfahimi opened this issue Aug 21, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@farshadfahimi
Copy link

I have two table with deleted_at fields and need to join both of them , but in the query builder when execute the query got ambiguous error on deleted_at colomn

@radmen
Copy link
Owner

radmen commented Aug 21, 2021

@farshadfahimi could you show me an example of your usecase?

@farshadfahimi
Copy link
Author

farshadfahimi commented Aug 22, 2021

@radmen
I have a model named Product and ProductCategories and both of them has deleted_at for soft deleting
and I'm Generate a query like below bot on executaion got ambiguous error

Products.query().whereIn('products.id', array).join('products_categories', 'products.categories_id', 'products_categories.id')

the soft delete add the deleted_at where and got ambiguous error

I think when you generate the query it' better to add table_name in where queries and the problem would be solved

@radmen
Copy link
Owner

radmen commented Aug 23, 2021

@farshadfahimi thanks for the example. I'll see what can be done, though please mind that I'm not actively maintaining this package. If you'd like to help with a PR, you're more than welcome :)

@radmen radmen added the bug Something isn't working label Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants