Skip to content

Commit

Permalink
Data fix for subsequent migration script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzohrab committed Jan 18, 2025
1 parent 17da3c1 commit 52293b1
Showing 1 changed file with 11 additions and 0 deletions.
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;

0 comments on commit 52293b1

Please sign in to comment.