Gorm 踩坑

  1. soft delete 之后如果想回复,可以直接设置deleted_at 为null,但是需要用unscoped去查,不然会查不到,根本原因是因为当mysql row 被 soft delete后,任何查询都会查不到deleted_at不为null的值

Leave a Reply

Your email address will not be published. Required fields are marked *