Error while using deleteMany(), ER_BAD_FIELD_ERROR: Unknown column 't0.id' in 'on clause'

System Information
  • 4.11.7:
  • MAC 13.4.1 (c) (22F770820d):
  • Mysql:
  • v18.15.0:
  • 9.5.0:
  • -:

I want to delete all the rows where the user is userId,
I checked all the details were correct

    await strapi.db.query("api::initiate-order.initiate-order").deleteMany({
        where: {
          users_permissions_user: userId,
        },
      });

But When I run this code I get an error that

[2023-07-29 18:19:53.734] error: delete `initiate_orders` from `initiate_orders` left join `initiate_orders_users_permissions_user_links` as `t1` on `t0`.`id` = `t1`.`initiate_order_id` left join `up_users` as `t2` on `t1`.`user_id` = `t2`.`id` where (`t2`.`id` = 1) - ER_BAD_FIELD_ERROR: Unknown column 't0.id' in 'on clause'
Error: ER_BAD_FIELD_ERROR: Unknown column 't0.id' in 'on clause'

As I follow all the instruction from

is there anybody here?