What happens if a "best reply" is deleted by its owner? Shouldn't we update the owning thread to nullify the
best_reply_id column? Otherwise, that column will refer to a reply that doesn't exist. In this episode, we'll add a database constraint to perform this update automatically. However, as we implement it, we'll encounter a few confusing issues that aren't so easy to debug.
View the source code for this episode on GitHub.
Published on Oct 3rd, 2017.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.