Here is the query I'm having a problem with:
UPDATE entry SET is_locked_by = NULL
WHERE id IN (
SELECT cee."entryId" FROM category_entries_entry AS cee
WHERE cee."categoryId" IN (${descendantsWithParent.map(c => c.id).join()})
LEFT JOIN category cat ON cee."categoryId" = cat.id WHERE NOT cat.is_locked
);
Category relates to Entry as ManyToMany. And I want to update all entries where category.is_locked is false.
This query does not seem to work, it seems to ignore the WHERE NOT cat.is_locked.
What is wrong with this query?
WHEREclauses in the inner query look sketchy