Page MenuHomePhabricator

removeNamespace.php script for both core and Flow
Open, HighPublic

Description

removeNamespace.php --id 104 --canonicalnamespace "Foo"

canonicalnamespace is the canonical namespace text for the just-removed namespace.

Find links with pl_namespace 104, then change pl_namespace to 0 and pl_title "Foo:" + pl_title.

E.g. if it was (104,Bar), now it's (0,Foo:Bar), as if the link was reparsed and the namespace didn't exist.

There shouldn't be any with pl_from_namespace 104 unless someone just removed a namespace with active pages(!).

Needs to be hookable so Flow can do the equivalent in its internal link tables.

Event Timeline

This is a lot more complicated than the description made it look - I see the following columns that may need to be updated:

  • archive: ar_namespace, ar_title
  • imagelinks: il_from_namespace
  • ipblocks_restrictions in some manner: blocked from ns:104, but that is removed, so what happens to the block?
  • logging: log_namespace, log_title
  • page: page_namespace, page_title
  • pagelinks: pl_from_namespace, pl_namespace, pl_title
  • protected_titles: pt_namespace, pt_title
  • querycache: qc_namespace, qc_title[1]
  • querycachetwo : qcc_namespace, qcc_title, qcc_namespacetwo, qcc_titletwo[1]
  • recentchanges: rc_namespace, rc_title
  • redirect: rd_namespace, rd_title
  • searchindex: si_title
  • templatelinks: tl_from_namespace, tl_namespace, tl_title

[1] Table could also be skipped and then repopulated