Commit graph

11 commits

Author SHA1 Message Date
Bart Schuurmans 4a690e675a BookDataModel: add dry_run argument to merge_into 2024-03-23 19:28:57 +01:00
Bart Schuurmans 7066e2815b BookDataModel.merge_into: return and log absorbed fields 2024-03-23 19:28:57 +01:00
Bart Schuurmans 5e123972e8 BookDataModel: implement merge_into method 2024-03-23 19:28:57 +01:00
Neil Roberts 71e2486d01 Move the merging code from deduplicate code to common module
That way it can be used in a new command to merge individual items.
2023-04-15 11:59:40 +02:00
Neil Roberts 2bbc9a16ad Fix deduplicating books that are on a shelf or in a list
Previously when the deduplicate_book_data script tried to merge an
edition that was on a shelf or in a list then it would fail because when
the canonical book was added to the shelf or the list then it wouldn’t
set the extra fields of the linking table for the “through” model of the
field. These would end up defaulting to NULL, but that is not valid for
some of the fields in ShelfItem and ListItem so postgres wouldn’t accept
it.

To fix that, this patch makes it skip updating fields that have a
non-autogenerated linking table. The linking table would appear as a
separate model anyway so the book will be moved via that instead.

Fixes: #2817
2023-04-15 11:59:12 +02:00
Josh Soref 45a1457a4f spelling: deduplications
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref c2022acf67 spelling: deduplicate
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Mouse Reeve 3ade2d3bb1 New version of black, new whitespace 2021-04-26 09:15:42 -07:00
Mouse Reeve 70296e760b Runs black 2021-03-08 08:49:10 -08:00
Mouse Reeve 1246042c12 move some code around for readability 2020-12-31 16:30:04 -08:00
Mouse Reeve c5a3e57bb4 Script for removing duplicates in book data 2020-12-31 16:03:54 -08:00