-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data fix for subsequent migration script.
- Loading branch information
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
lute/db/schema/migrations/20241220_fix_for_wordsread_table_load.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Manual fix for 20241221_add_wordsread_table.sql, which will be run after this script! | ||
-- | ||
-- Hacky fix: a user had a problem during startup and running of the above script | ||
-- at query | ||
-- insert into wordsread (WrLgID, WrTxID, WrReadDate, WrWordCount) | ||
-- select bklgid, txid, txreaddate, txwordcount from texts inner join books on bkid=txbkid where txreaddate is not null; | ||
-- b/c somehow a text had txreaddate not null, but txwordcount = null. | ||
-- | ||
-- SHOULD NEVER HAVE HAPPENED but what are you going to do. | ||
|
||
update texts set txwordcount = 0 where txwordcount is null and txreaddate is not null; |