Thread: author sort
View Single Post
Old 01-24-2022, 09:01 PM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Honestly, I wouldn't have suggested it if I hadn't checked. There is no need to use the ids as we want to update the author sort associated with an authors name.

The rough steps are:

Export the 'authors' table to a file.

Edit the file to produce update statements. Each would look like:

Code:
UPDATE authors SET sort = '<sort value from file>' WHERE name = '<name value from file>';
Run each of these statements on the other database. If the author exists, it gets updated. If it doesn't, nothing will happen.


I don't really suggest it, as it needs to be redone as you add books with new authors the libraries. But, as a one off to clean up past crimes, it would work. And if course, anyone who did this, would need to make sure they knew what they were doing and had a good backup.
davidfor is offline   Reply With Quote