librivox-catalog icon indicating copy to clipboard operation
librivox-catalog copied to clipboard

Table "keywords" lacks UNIQUE constraint on field "value"

Open peterjdann opened this issue 8 months ago • 4 comments

It should not be possible, even accidentally or by the result of a programming error, to add an entry to table "keywords" that duplicates a value already present.

You have check the number of duplicate values in that table by running the following SQL:

SELECT value, COUNT(value) FROM keywords GROUP BY value HAVING COUNT(value) > 1

In the scrubbed development database, this currently shows three duplicate values.

If/when administrators become more conscious of what keywords have been applied to audiobooks as a result of mooted changes that are currently the subject of two pull requests, it is possible they may seek to edit the contents of some keywords and, in the process (depending on what safeguards the Librivox software implements short of a DB field constraint) they may be able, in the process, to create further duplicates in this table, thus rendering any search-by-keywords process inaccurate.

peterjdann avatar Jun 28 '24 08:06 peterjdann