Anki/rslib/src/storage/card/fix_due_other.sql
Damien Elmes d7f9bccd1e rewrite DB check
- notes with wrong field count are now recovered instead of
being deleted
- notes with missing note types are now recovered
- notes with missing cards are now recovered
- recover_missing_deck() still needs implementing
- checks required
2020-05-12 21:13:34 +10:00

19 lines
No EOL
328 B
SQL

update cards
set
due = (
case
when queue = 2
and due > 100000 then ?1
else min(max(round(due), -2147483648), 2147483647)
end
),
mod = ?2,
usn = ?3
where
due != (
case
when queue = 2
and due > 100000 then ?1
else min(max(round(due), -2147483648), 2147483647)
end
);