Jump to content

Wikipedia:Subpages to be moved/How to update

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by MZMcBride (talk | contribs) at 03:22, 29 August 2013 (bug!). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

#use at your own risk
#no warranty implied or given
#please improve.

DROP TABLE IF EXISTS slashes;

CREATE TABLE slashes (UNIQUE KEY `cur_id` (`cur_id`)) 
SELECT cur_title, cur_id
FROM cur 
WHERE cur_is_redirect=0
AND cur_title LIKE '%/%'
AND cur_namespace=0
LIMIT 1000;

DELETE FROM slashes
USING slashes, links
WHERE cur_id=l_to
AND l_from LIKE 'Wikipedia:Articles_with_slashes_in_title';

SELECT CONCAT('#[[',REPLACE (cur_title, '_', ' '),']]') AS new_slash_titles
FROM slashes 
ORDER BY Lower(cur_title)