mirror of
https://github.com/ankitects/anki.git
synced 2026-01-12 21:44:01 -05:00
https://forums.ankiweb.net/t/statistics-messed-up-after-fsrs-reschedule/54622 Caused by syncing the revlogs in a normal sync to a client that doesn't understand them yet - they end up using the default for RevlogReviewKind instead, which is 0.
23 lines
No EOL
585 B
SQL
23 lines
No EOL
585 B
SQL
UPDATE revlog
|
|
SET ivl = min(max(round(ivl), -2147483648), 2147483647),
|
|
lastIvl = min(max(round(lastIvl), -2147483648), 2147483647),
|
|
time = min(max(round(time), 0), 2147483647),
|
|
type = (
|
|
CASE
|
|
WHEN type = 0
|
|
AND time = 0
|
|
AND ease = 0 THEN 5
|
|
ELSE type
|
|
END
|
|
)
|
|
WHERE ivl != min(max(round(ivl), -2147483648), 2147483647)
|
|
OR lastIvl != min(max(round(lastIvl), -2147483648), 2147483647)
|
|
OR time != min(max(round(time), 0), 2147483647)
|
|
OR type != (
|
|
CASE
|
|
WHEN type = 0
|
|
AND time = 0
|
|
AND ease = 0 THEN 5
|
|
ELSE type
|
|
END
|
|
) |