new non-stub Indonesian language file
[mediawiki.git] / docs / schema.doc
blob11d6ba5d1779e20d9128bc9ee67e22b6a5550e02
1 SCHEMA.DOC
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 highlight that may be out of date:
8 user    (Wikipedia users)
10   user_id
11     integer, primary key, autoincrement
12   user_name
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?)
17   user_rights
18     Comma-separated list of textual flags.
19   user_password
20     Hash of current password.
21   user_newpassword
22     Generated for mail-a-new-password feature
23   user_email
24     Note -- email should be restricted, not public info.
25     Same with passwords. ;)
26   user_options
27     Newline-separated list of name=value pairs.
31 cur     (Wikipedia "current" articles)
33   cur_id
34     integer, primary key, autoincrement
35   cur_namespace
36     integer index into list of namespaces.  See the
37     Namespace class for more details.
38   cur_title
39     Title of article (in dbkey form--see Title), without
40     namespace.  The combination of namespace,title should
41     be unique in this table.
42   cur_text
43     Wikitext of the article.
44   cur_comment
45     The summary of the last change.
46   cur_user
47     User id who made the last change, or 0 if unknown.
48   cur_user_text
49     Name of the user above, or IP address.
50   cur_timestamp
51     Time of the last change.
52   cur_minor_edit
53     Flag: 0 or 1 is last change was a "minor" edit.
54   cur_restrictions
55     Who may or may not edit the article.
56   cur_counter
57     Number of times this page has been viewed.
58   cur_ind_title
59     Text version of title for fulltext searches.
60   cur_ind_text
61     Plaintext version of text for fulltext searches.
62   cur_is_redirect
63     1 indicates the article is a redirect.
64   cur_minor_edit
65     1 indicates this was a minor edit.
66   cur_is_new
67     1 indicates this is the first revision of a new entry.
71 old     (Historical versions articles. Most fields
72         correspond to the same fields in "cur")
74   old_id
75   old_namespace
76   old_title
77   old_text
78   old_comment
79   old_user
80   old_user_text
81   old_timestamp
82   old_minor_edit
83   old_flags
84     This last is currently unused.
88 archive (Temporary storage of deleted articles which may be restored.
89                 Fields correspond to those of "cur" and "old")
90   ar_namespace
91   ar_title
92   ar_text
93   ar_comment
94   ar_user
95   ar_user_text
96   ar_timestamp
97   ar_minor_edit
98   ar_flags
99     This last is currently unused.
103 links   (Internal links to existing articles)
105   l_from
106     ID of source article. (currently title, may be changed)
107   l_to
108     ID of target article.
112 brokenlinks (Internal links to non-existent articles)
114   bl_from
115     ID of source link.
116   bl_to
117     Title of target link.
121 imagelinks (Internal links to images via [[Image:filename]] syntax)
123   il_from
124     Title of target article.
125   il_to
126     Filename of target image.
130 image (Uploaded images and other files)
132   img_name
133     Filename.
134   img_size
135     File size in bytes.
136   img_description
137     Description field given during upload.
138   img_user
139     User ID who uploaded the file.
140   img_user_text
141     User name who uploaded the file.
142   img_timestamp
143     Timestamp when upload took place.
147 oldimage (Old versions of images stored for potential revert)
149   oi_name
150     Original filename.
151   oi_archive_name
152     Filename of stored old revision; timestamp and
153     exclaimation point prepended to oi_name
154   oi_size
155     File size in bytes.
156   oi_description
157     Description field given during upload.
158   oi_user
159     User ID who uploaded the file.
160   oi_user_text
161     User name who uploaded the file.
162   oi_timestamp
163     Timestamp when upload took place.
167 ipblocks (IP addresses and users blocked from editing)
168   ipb_id
169     Primary key, introduced for privacy. 
170   ipb_address
171     Blocked IP address in dotted-quad form or user name.
172   ipb_user
173     Blocked user ID or 0 for IP blocks.
174   ipb_by
175     User ID who made the block.
176   ipb_reason
177     Text comment made by blocker.
178   ipb_timestamp
179     Creation (or refresh) date in standard YMDHMS form. IP
180     blocks expire automatically.
181   ipb_auto
182     Indicates that the IP address was banned because a banned
183     user accessed a page through it. If this is 1, ipb_address
184     will be hidden.
187 random (Random page queue)
189   ra_current
190     1 = hasn't come up on a random page view yet.
191     >1 = has been viewed, will be ignored for a few
192   ra_title
193     Title of an article.
197 site_stats (Site-wide statistics)
199   ss_row_id
200     Token for where clauses.  There's only one row in
201     this table.  At some point we might want to use a
202     date here so we can get stats-by-date.
203   ss_total_views
204     Number of total views of all pages.
205   ss_total_edits
206     Number of total page edits.
207   ss_good_articles
208     Number of "countable" articles.
212 recentchanges
214   (Will document further when working)
218 watchlist
220   wl_user
221     Foreign key -> user_id
222   wl_namespace
223     Namespace -> cur_namespace
224     Note that these should only include even-numbered
225     namespaces for regular pages; associated talk pages
226     (odd numbered namespaces) are folded in.
227   wl_title
228     Page title -> cur_title
229     Note also that the linked page may not exist in page
230     or talk namespace, or at all.