Fill the `card.last_review_time` field when `Check Database`

In this PR, I add last_review_time to card data for performance and accuracy:

But the last_review_time field is assigned only when the user reviews an existing cards. It will take a long to fill them all.

When last_review_time field is empty, the retrievability sorting can be wrong if the user applied set due date in an older version of Anki:

So, how about filling the last_review_time field of card when Check Database? We can fill the field by querying the revlog table to get the correct value.

How about saving the review time when its calculated in card_stats as well?

Here is the PR:

Is the last_review_time going to be available in the states provided to the custom scheduling JS? I’m currently implementing the last review time myself in card.custom_data and it would nice if that was no longer necessary.

I recommend opening a new post to suggest it.