I've been staring at the mediawiki database for my site. I want to create a linear list of pages ordered by the original creation date of the page.

I can't find a timestamp anywhere that indicates the first creation date of the page.

I can find revision timestamps with no problem, in the revision table...but no original creation timestamp. Furthermore, "page_touched" won't work since all these pages were xml imported recently, so they were all touched.

Any ideas?

有帮助吗?

解决方案

Based on the layout of the revision table. I did not test it, nor have seriously considered possible corner cases.

SELECT rev_page, rev_timestamp
FROM revision
WHERE rev_parent_id = 0
ORDER BY rev_timestamp

The first revision of a page has rev_parent_id = 0, so we take its timestamp as the creation timestamp.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top