- UNIQUE KEY user_id (user_id)
-) PACK_KEYS=1;
-
-CREATE TABLE user_newtalk (
- user_id int(5) NOT NULL default '0',
- user_ip varchar(40) NOT NULL default ''
-);
-
-CREATE TABLE cur (
- cur_id int(8) unsigned NOT NULL auto_increment,
- cur_namespace tinyint(2) unsigned NOT NULL default '0',
- cur_title varchar(255) binary NOT NULL default '',
- cur_text mediumtext NOT NULL default '',
- cur_comment tinyblob NOT NULL default '',
- cur_user int(5) unsigned NOT NULL default '0',
- cur_user_text varchar(255) binary NOT NULL default '',
- cur_timestamp char(14) binary NOT NULL default '',
- cur_restrictions tinyblob NOT NULL default '',
- cur_counter bigint(20) unsigned NOT NULL default '0',
- cur_is_redirect tinyint(1) unsigned NOT NULL default '0',
- cur_minor_edit tinyint(1) unsigned NOT NULL default '0',
- cur_is_new tinyint(1) unsigned NOT NULL default '0',
- cur_random real unsigned NOT NULL,
- cur_touched char(14) binary NOT NULL default '',
- inverse_timestamp char(14) binary NOT NULL default '',
- UNIQUE KEY cur_id (cur_id)
-) PACK_KEYS=1;
-
-CREATE TABLE old (
+ user_token char(32) binary NOT NULL default '',
+ PRIMARY KEY user_id (user_id),
+ INDEX user_name (user_name(10))
+);
+
+-- TODO: de-blob this; it should be a property table
+CREATE TABLE /*$wgDBprefix*/user_rights (
+ ur_user int(5) unsigned NOT NULL,
+ ur_rights tinyblob NOT NULL default '',
+ UNIQUE KEY ur_user (ur_user)
+);
+
+-- The following table is no longer needed with Enotif >= 2.00
+-- Entries for newtalk on user_talk page are handled like in the watchlist table
+-- CREATE TABLE /*$wgDBprefix*/user_newtalk (
+-- user_id int(5) NOT NULL default '0',
+-- user_ip varchar(40) NOT NULL default '',
+-- INDEX user_id (user_id),
+-- INDEX user_ip (user_ip)
+-- );
+
+CREATE TABLE /*$wgDBprefix*/page (
+ -- Identifiers:
+ page_id int(8) unsigned NOT NULL auto_increment,
+ page_namespace tinyint NOT NULL,
+ page_title varchar(255) binary NOT NULL,
+
+ -- Mutable information
+ page_restrictions tinyblob NOT NULL default '',
+ page_counter bigint(20) unsigned NOT NULL default '0',
+ page_is_redirect tinyint(1) unsigned NOT NULL default '0',
+ page_is_new tinyint(1) unsigned NOT NULL default '0',
+ page_random real unsigned NOT NULL,
+ page_touched char(14) binary NOT NULL default '',
+
+ -- Handy key to revision.rev_id of the current revision
+ page_latest int(8) unsigned NOT NULL,
+ page_len int(8) unsigned NOT NULL,
+
+ PRIMARY KEY page_id (page_id),
+ UNIQUE INDEX name_title (page_namespace,page_title),
+
+ -- Special-purpose indexes
+ INDEX (page_random),
+ INDEX (page_len)
+);
+
+CREATE TABLE /*$wgDBprefix*/revision (
+ rev_id int(8) unsigned NOT NULL auto_increment,
+ rev_page int(8) unsigned NOT NULL,
+ rev_text_id int(8) unsigned NOT NULL,
+ rev_comment tinyblob NOT NULL default '',
+ rev_user int(5) unsigned NOT NULL default '0',
+ rev_user_text varchar(255) binary NOT NULL default '',
+ rev_timestamp char(14) binary NOT NULL default '',
+ rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
+ rev_deleted tinyint(1) unsigned NOT NULL default '0',
+
+ PRIMARY KEY rev_page_id (rev_page, rev_id),
+ UNIQUE INDEX rev_id (rev_id),
+ INDEX rev_timestamp (rev_timestamp),
+ INDEX page_timestamp (rev_page,rev_timestamp),
+ INDEX user_timestamp (rev_user,rev_timestamp),
+ INDEX usertext_timestamp (rev_user_text,rev_timestamp)
+);
+
+
+--
+-- Holds text of individual page revisions.
+--
+CREATE TABLE /*$wgDBprefix*/text (