adonis-lucid-soft-deletes
adonis-lucid-soft-deletes copied to clipboard
ambiguous error while join two table with soft delete
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
@farshadfahimi could you show me an example of your usecase?
@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
@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 :)