Page MenuHomePhabricator

Categorylinks table should use category ID rather than category name in cl_to field
Closed, DeclinedPublic


Rather than containing the category's name, the cl_to field should contain the category ID as defined in the category table. This would make moving categories (GSoC project) much easier and doesn't store the category name in two places.

BTW, has the category table been built on WMF wikis yet?

Version: 1.13.x
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:02 PM
bzimport set Reference to bz13579.
bzimport added a subscriber: Unknown Object (MLST).
Catrope created this task.Apr 1 2008, 6:25 PM

ayg wrote:

Yes, it has, long ago. A major reason for this change would be a much smaller (therefore faster) categorylinks table.

brion added a comment.Apr 1 2008, 10:27 PM

The link tables specify text rather than IDs for rename safety... the links are created by text in the article (and any templates it uses, and any parser functions it calls, etc), which would not be changed by any alteration to the target page.

Things get ugly when you have to try to figure out how to go back and change texts. :)

ayg wrote:

Conveniently, categories can't be renamed, so that's not a big issue at present. ;) Any implementation of this big a change should wait until an implementation of category redirects/renaming, which could easily require changes to categorylinks too. It would be fairly annoying to change the schema in such a major way *twice*, not just for whoever does the alters but also for extension authors, etc.

Danny_B moved this task from Unsorted to Change on the Schema-change board.May 4 2016, 3:11 AM
Krinkle closed this task as Declined.May 24 2017, 12:53 PM
Krinkle added subscribers: brion, Krinkle.

Per @brion, link tables represent secondary data (derived data) based on the wiki pages and their meta data. Wiki pages use category links based on titles, not IDs. Categories could be deleted, re-created, renamed, but that doesn't change that the pages continue to point to a category name.

If and when meta data starts being stored separately with a layer of indirection in the interface (e.g. categories are identified by an id with a display title that is only that, a display title), this will happen naturally, so there's no need for this task to exist.