User:Nixeagle/dbformats

CREATE TABLE `page` ( `page_id` int(10) unsigned NOT NULL auto_increment,  `page_namespace` int(11) NOT NULL,  `page_title` varchar(255) character set latin1 collate latin1_bin NOT NULL,  `page_restrictions` tinyblob NOT NULL,  `page_counter` bigint(20) unsigned NOT NULL default '0',  `page_is_redirect` tinyint(3) unsigned NOT NULL default '0',  `page_is_new` tinyint(3) unsigned NOT NULL default '0',  `page_random` double unsigned NOT NULL,  `page_touched` binary(14) NOT NULL default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',  `page_latest` int(10) unsigned NOT NULL,  `page_len` int(10) unsigned NOT NULL,  PRIMARY KEY  (`page_id`),  UNIQUE KEY `name_title` (`page_namespace`,`page_title`),  KEY `page_random` (`page_random`),  KEY `page_len` (`page_len`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `revision` ( `rev_id` int(10) unsigned NOT NULL auto_increment,  `rev_page` int(10) unsigned NOT NULL,  `rev_text_id` int(10) unsigned NOT NULL,  `rev_comment` tinyblob NOT NULL,  `rev_user` int(10) unsigned NOT NULL default '0',  `rev_user_text` varchar(255) character set latin1 collate latin1_bin NOT NULL default '',  `rev_timestamp` binary(14) NOT NULL default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',  `rev_minor_edit` tinyint(3) unsigned NOT NULL default '0',  `rev_deleted` tinyint(3) unsigned NOT NULL default '0',  `rev_len` int(10) unsigned default NULL,  `rev_parent_id` int(10) unsigned default NULL,  PRIMARY KEY  (`rev_page`,`rev_id`),  UNIQUE KEY `rev_id` (`rev_id`),  KEY `rev_timestamp` (`rev_timestamp`),  KEY `page_timestamp` (`rev_page`,`rev_timestamp`),  KEY `user_timestamp` (`rev_user`,`rev_timestamp`),  KEY `usertext_timestamp` (`rev_user_text`,`rev_timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;

CREATE TABLE `text` ( `old_id` int(10) unsigned NOT NULL auto_increment,  `old_text` mediumblob NOT NULL,  `old_flags` tinyblob NOT NULL,  PRIMARY KEY  (`old_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;