Skip to content

Using soft deletes can lead to mysql ambiguous exception #1881

Description

@niteraven7

If two tables use soft deletes and you join them together the deleted field becomes ambiguous.

For example (I believe this query is created for pagination):

SELECT COUNT(*) AS numrows
FROM recipient
INNER JOIN location ON recipient.location_id = location.id
WHERE location.business_id = 3
AND deleted = 0

deleted should be recipient.deleted to correct the issue.

version: beta1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions