Skip to content

on_delete setting is casting uuids, which makes queries fail #119

@LostKobrakai

Description

@LostKobrakai
Repo.delete_all(Dresser.Schema.PieceImage |> where(piece_id: ^piece.id))

The above results in the following (working) query.

DELETE FROM "piece_images" AS p0 WHERE (p0."piece_id" = ?) ["f1511051-0079-448b-b0b9-562d71b0ad96"]

But deleting a (parent) record, where on_delete: :delete_all is set on a relationship (many_to_many here) I get the following query, which doesn't work:

DELETE FROM "piece_images" AS p0 WHERE (p0."piece_id" = CAST(? AS BLOB)) ["7e162d9e-3e22-4846-adf1-b4abd25966ac"]

The latter query works with the binary_id_type: :string setting (still casting, but to TEXT), but using binary_id_type: :binary it doesn't work.

exqlite 0.13.5 / ecto_sqlite3 0.10.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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