On our test server we found that we have a few CommentReportLog records whose rid is not a valid index into the SubPostCommentReport table. The foreign key constraint on the rid was broken until recently which permitted the invalid entries to be inserted. I haven't been able to figure out where in current or past versions of the code an invalid rid could be inserted.
Our production database does not contain any invalid rids.
The invalid rids caused the migration from #247 to fail when run on our test server. This change fixes the failing migration by dropping any records from the CommentReportLog table with an invalid rid.
On our test server we found that we have a few
CommentReportLog
records whoserid
is not a valid index into theSubPostCommentReport
table. The foreign key constraint on therid
was broken until recently which permitted the invalid entries to be inserted. I haven't been able to figure out where in current or past versions of the code an invalidrid
could be inserted.Our production database does not contain any invalid
rid
s.The invalid
rid
s caused the migration from #247 to fail when run on our test server. This change fixes the failing migration by dropping any records from theCommentReportLog
table with an invalidrid
.