3 The most up-to-date schema for the tables in the database
4 should always be "tables.sql" in the maintenance directory,
5 which is called from the installation script. Here are a
6 few highlights that may be out of date:
11 integer, primary key, autoincrement
13 Usernames must be unique, must not be in the form of
14 an IP address. _Shouldn't_ allow slashes or case
15 conflicts. Spaces are allowed, and are _not_ converted
16 to underscores like titles. (Conflicts?)
18 Hash of current password.
20 Generated for mail-a-new-password feature
22 Note -- email should be restricted, not public info.
23 Same with passwords. ;)
25 Newline-separated list of name=value pairs.
27 A pseudorandomly generated value that is stored in
28 a cookie when the "remember password" feature is
29 used (previously, a hash of the password was used, but
30 this was vulnerable to cookie-stealing attacks)
34 cur (Wikipedia "current" articles)
37 integer, primary key, autoincrement
39 integer index into list of namespaces. See the
40 Namespace class for more details.
42 Title of article (in dbkey form--see Title), without
43 namespace. The combination of namespace,title should
44 be unique in this table.
46 Wikitext of the article.
48 The summary of the last change.
50 User id who made the last change, or 0 if unknown.
52 Name of the user above, or IP address.
54 Time of the last change.
56 Flag: 0 or 1 is last change was a "minor" edit.
58 Who may or may not edit the article.
60 Number of times this page has been viewed.
62 Text version of title for fulltext searches.
64 Plaintext version of text for fulltext searches.
66 1 indicates the article is a redirect.
68 1 indicates this was a minor edit.
70 1 indicates this is the first revision of a new entry.
72 Random value between 0 and 1, used for
77 old (Historical versions articles. Most fields
78 correspond to the same fields in "cur")
90 This last is currently unused.
94 archive (Temporary storage of deleted articles which may be restored.
95 Fields correspond to those of "cur" and "old")
105 This last is currently unused.
109 links (Internal links to existing articles)
112 ID of source article. (currently title, may be changed)
114 ID of target article.
118 brokenlinks (Internal links to non-existent articles)
123 Title of target link.
127 imagelinks (Internal links to images via [[Image:filename]] syntax)
130 Title of target article.
132 Filename of target image.
136 categorylinks (Track category inclusions)
139 corresponds to cur_id of the linking page
141 corresponds to cur_title of the category page
143 the title of the linking page, or an optional override
145 when the link was last added
149 linkscc (Stores (possibly gzipped) serialized objects with
150 cache arrays to reduce database load slurping up
151 from links and brokenlinks.)
154 The ID of the linking page
156 A serialized LinkCache object
160 image (Uploaded images and other files)
167 Description field given during upload.
169 User ID who uploaded the file.
171 User name who uploaded the file.
173 Timestamp when upload took place.
177 oldimage (Old versions of images stored for potential revert)
182 Filename of stored old revision; timestamp and
183 exclaimation point prepended to oi_name
187 Description field given during upload.
189 User ID who uploaded the file.
191 User name who uploaded the file.
193 Timestamp when upload took place.
197 ipblocks (IP addresses and users blocked from editing)
199 Primary key, introduced for privacy.
201 Blocked IP address in dotted-quad form or user name.
203 Blocked user ID or 0 for IP blocks.
205 User ID who made the block.
207 Text comment made by blocker.
209 Creation (or refresh) date in standard YMDHMS form. IP
210 blocks expire automatically.
212 Indicates that the IP address was banned because a banned
213 user accessed a page through it. If this is 1, ipb_address
217 site_stats (Site-wide statistics)
220 Token for where clauses. There's only one row in
221 this table. At some point we might want to use a
222 date here so we can get stats-by-date.
224 Number of total views of all pages.
226 Number of total page edits.
228 Number of "countable" articles.
232 hitcounter (Stores an ID for every time any article is visited;
233 depending on $wgHitcounterUpdateFreq, it is
234 periodically cleared and the cur_counter column
235 in the cur table updated for the all articles
236 that have been visited.)
238 The ID of an article, representing one hit
244 (Will document further when working)
251 Foreign key -> user_id
253 Namespace -> cur_namespace
254 Note that these should only include even-numbered
255 namespaces for regular pages; associated talk pages
256 (odd numbered namespaces) are folded in.
258 Page title -> cur_title
259 Note also that the linked page may not exist in page
260 or talk namespace, or at all.
263 searchindex (Used for MySQL fulltext searching)
268 The title of an article, indexed for searching
270 The text of an article, indexed for searching
274 interwiki (Recognized interwiki link prefixes)
276 The interwiki prefix, (e.g. "Meatball", or the
277 language prefix "de")
279 The URL of the wiki, with "$1" as a placeholder
282 A boolean value indicating whether the wiki is
283 in this project (used, for example, to detect