It would be best if we can check your logic ourselves :)
Tracing what is causing duplicates?
I appreciate this is a 'how long is a piece of string' question, but I want to make sure I'm not missing something obvious or whether there is another way to tackle / investigate this.
I have a Student model that occasionally has duplicate rows. I've reviewed all the updateOrCreate statements, and they appear to be correct i.e. If a student with a given email exists, update them, otherwise create. There are no other methods in use for creating students.
However, all duplicates have the same email.
Besides logging the SQL statements being made, is there any good methodology for tracing this behaviour?
Please or to participate in this conversation.