The table was defined without a primary key. This can cause the multiple presence of the rows under special circumstances (in example after a reimport of the data into the table). This in turn can mean that not all existing values can be managed and utilised.
With the change the old table will be renamed, a new table with a PK will be created and the existing data will be imported into the new table. With the use of one INSERT with GROUP_CONCAT() of the data it is ensured, that the content of the column list of every row with the specified value for the column name gets part of only one row with the specified name value. The last step is to drop the old table from the database.
Known issue: when entries are part of multiple rows in the old table, they will be there multiple times in one row of the new table.
Example:
old table:
==========
name | list
------------
words | foo
| bar
| baz
------------
words | foo
| baz
new table:
==========
name | list
------------
words | foo
| foo
| bar
| baz
| baz
Ths does not affect the feature in itself because a check for a banned value will find the value anyway. It is therefore not immediately necessary to de-duplicate the values. It can be done with another pull request.
The table was defined without a primary key. This can cause the multiple presence of the rows under special circumstances (in example after a reimport of the data into the table). This in turn can mean that not all existing values can be managed and utilised.
With the change the old table will be renamed, a new table with a PK will be created and the existing data will be imported into the new table. With the use of one
INSERT
withGROUP_CONCAT()
of the data it is ensured, that the content of the columnlist
of every row with the specified value for the columnname
gets part of only one row with the specifiedname
value. The last step is to drop the old table from the database.Known issue: when entries are part of multiple rows in the old table, they will be there multiple times in one row of the new table.
Example:
Ths does not affect the feature in itself because a check for a banned value will find the value anyway. It is therefore not immediately necessary to de-duplicate the values. It can be done with another pull request.
This fixes #710.