Moved image metadata to the database. Changed Image object to have lightweight constr...
[lhc/web/wiklou.git] / maintenance / archives / patch-logging.sql
1 -- Add the logging table and adjust recentchanges to accomodate special pages
2 -- 2004-08-24
3
4 CREATE TABLE /*$wgDBprefix*/logging (
5 -- Symbolic keys for the general log type and the action type
6 -- within the log. The output format will be controlled by the
7 -- action field, but only the type controls categorization.
8 log_type char(10) NOT NULL default '',
9 log_action char(10) NOT NULL default '',
10
11 -- Timestamp. Duh.
12 log_timestamp char(14) NOT NULL default '19700101000000',
13
14 -- The user who performed this action; key to user_id
15 log_user int unsigned NOT NULL default 0,
16
17 -- Key to the page affected. Where a user is the target,
18 -- this will point to the user page.
19 log_namespace tinyint unsigned NOT NULL default 0,
20 log_title varchar(255) NOT NULL default '',
21
22 -- Freeform text. Interpreted as edit history comments.
23 log_comment varchar(255) NOT NULL default '',
24
25 KEY type_time (log_type, log_timestamp),
26 KEY user_time (log_user, log_timestamp),
27 KEY page_time (log_namespace, log_title, log_timestamp)
28 );
29
30 -- Change from unsigned to signed so we can store special pages
31 ALTER TABLE recentchanges
32 MODIFY rc_namespace tinyint(3) NOT NULL default '0';