Skip to content

DELETE through backward relation generates invalid SQL on SQLite/PostgreSQL #2152

@themavik

Description

@themavik

Bug Description

Deleting objects through a backward relation generates DELETE FROM "book" LEFT OUTER JOIN ... which is invalid SQL in SQLite and PostgreSQL. Only MySQL supports DELETE with JOIN.

Expected Behavior

Use a subquery: DELETE FROM book WHERE id IN (SELECT book.id FROM book JOIN author ...)

Related to #1981.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions