Closed tonyarnold closed 4 years ago
I'm currently composing a query using the following code:
DeviceActivation.query(on: connectable) .join(\License.id, to: \DeviceActivation.licenseID) .filter(\License.key == key) .delete()
Unfortunately, when it is run, the SQL query that is generated is logged as:
[psql] [2019-12-10 09:37:43 +0000] DELETE FROM "DeviceActivation" WHERE "License"."key" = ($1) ["SOME_VALUE_I_NEED" (TEXT)]
It's completely missing the join. Am I doing something wrong?
Joins aren't currently supported on delete(). As a workaround you can select all the IDs then do a delete without joining. Or raw sql of course.
delete()
Ah, right, yep - that makes sense. Thanks, @tanner0101!
I'm currently composing a query using the following code:
Unfortunately, when it is run, the SQL query that is generated is logged as:
It's completely missing the join. Am I doing something wrong?