Topic on Talk:Quarry

Jump to navigation Jump to search

How do you find the original uploader of a file?

Jarekt (talkcontribs)
use commonswiki_p;
SELECT page_title, actor_name
FROM page
JOIN image ON img_name = page_title 
join actor on img_actor=actor_id # get the last uploader
WHERE page_namespace = 6
AND   page_id = 15730

lists the username of the last uploader of File:Mta_station_wall.jpg. How do you look up the name of the original uploader?

Tohaomg (talkcontribs)

Join it with 'revision' table and add the condition 'rev_parent_id = 0' which means that it is a page creation (no previous version). Then find the original uploader using 'rev_actor' field

Edgars2007 (talkcontribs)

Seems to be that only revision table has that information:

use commonswiki_p;
from revision
where rev_page=15730 and rev_parent_id=0
Edgars2007 (talkcontribs)

(that kind of was "edit conflict")

Reply to "How do you find the original uploader of a file?"