r85751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85750‎ | r85751 | r85752 >
Date:08:05, 10 April 2011
Author:maxsem
Status:deferred
Tags:
Comment:
SQLite-compatible schema. Gave indexes explicit names - my grepping indicates that it shouldn't break anything.
Modified paths:
  • /branches/lqt-updates/extensions/LiquidThreads/new-schema.sql (modified) (history)

Diff [purge]

Index: branches/lqt-updates/extensions/LiquidThreads/new-schema.sql
@@ -6,20 +6,20 @@
77 -- Channel table
88 -- See LiquidThreadsChannel class
99 CREATE TABLE /*_*/lqt_channel (
10 - lqc_id bigint(10) unsigned not null auto_increment,
 10+ lqc_id bigint(10) unsigned primary key not null auto_increment,
1111
1212 -- NS/title pair of the talk page this channel is attached to.
1313 lqc_page_namespace int(2) not null,
14 - lqc_page_title varbinary(255) not null,
15 -
16 - PRIMARY KEY (lqc_id),
17 - UNIQUE KEY (lqc_page_namespace,lqc_page_title)
 14+ lqc_page_title varbinary(255) not null
1815 ) /*$wgDBTableOptions*/;
1916
 17+CREATE UNIQUE INDEX /*i*/lqc_page_namespace_title ON /*_*/lqt_channel (lqc_page_namespace, lqc_page_title);
 18+
 19+
2020 -- Topic table
2121 -- See LiquidThreadsTopic class
2222 CREATE TABLE /*_*/lqt_topic (
23 - lqt_id bigint(10) unsigned not null auto_increment,
 23+ lqt_id bigint(10) unsigned PRIMARY KEY not null auto_increment,
2424
2525 -- The current version of this topic.
2626 -- Foreign key to lqt_topic_version.ltv_id
@@ -30,16 +30,16 @@
3131
3232 -- The Channel that this topic is contained in.
3333 -- Foreign key to lqt_channel.lqc_id
34 - lqt_channel bigint(10) unsigned not null,
35 -
36 - PRIMARY KEY (lqt_id),
37 - KEY (lqt_channel)
 34+ lqt_channel bigint(10) unsigned not null
3835 ) /*$wgDBTableOptions*/;
3936
 37+CREATE INDEX /*i*/lqt_topic_channel ON /*_*/lqt_topic (lqt_channel);
 38+
 39+
4040 -- Topic Version table
4141 -- See LiquidThreadsTopicVersion class
4242 CREATE TABLE /*_*/lqt_topic_version (
43 - ltv_id bigint(10) unsigned not null auto_increment,
 43+ ltv_id bigint(10) unsigned PRIMARY KEY not null auto_increment,
4444
4545 -- The topic to which this version applies
4646 -- Foreign key to lqt_topic.lqt_id
@@ -63,17 +63,17 @@
6464 ltv_summary_text_id bigint(10) unsigned not null,
6565
6666 ltv_subject TINYBLOB NOT NULL,
67 - ltv_channel bigint(10) unsigned not null,
68 -
69 - PRIMARY KEY (ltv_id),
70 - KEY (ltv_topic, ltv_timestamp),
71 - KEY (ltv_user_id,ltv_user_ip)
 67+ ltv_channel bigint(10) unsigned not null
7268 ) /*$wgDBTableOptions*/;
7369
 70+CREATE INDEX /*i*/ltv_topic_timestamp ON /*_*/lqt_topic_version (ltv_topic, ltv_timestamp);
 71+CREATE INDEX /*i*/ltv_user_id_ip ON /*_*/lqt_topic_version (ltv_user_id, ltv_user_ip);
 72+
 73+
7474 -- Post table
7575 -- See LiquidThreadsPost class
7676 CREATE TABLE /*_*/lqt_post (
77 - lqp_id bigint(10) unsigned not null auto_increment,
 77+ lqp_id bigint(10) unsigned PRIMARY KEY not null auto_increment,
7878
7979 -- Current version of this post.
8080 -- Foreign key to lqt_topic_version.lpv_id
@@ -91,17 +91,16 @@
9292
9393 -- Parent post. Potentially blank, if it's at the top level in the topic.
9494 -- Foreign key to lqt_post.lqp_id
95 - lqp_parent_post bigint(10) unsigned null,
96 -
97 - PRIMARY KEY (lqp_id),
98 - KEY (lqp_topic, lqp_parent_post)
99 -
 95+ lqp_parent_post bigint(10) unsigned null
10096 ) /*$wgDBTableOptions*/;
10197
 98+CREATE INDEX /*i*/lqp_topic_parent ON /*_*/lqt_post (lqp_topic, lqp_parent_post);
 99+
 100+
102101 -- Post Version table
103102 -- See LiquidThreadsPostVersion class
104103 CREATE TABLE /*_*/lqt_post_version (
105 - lpv_id bigint(10) unsigned not null auto_increment,
 104+ lpv_id bigint(10) unsigned PRIMARY KEY not null auto_increment,
106105
107106 -- The post to which this version applies.
108107 -- Foreign key to lqt_post.lqp_id
@@ -142,8 +141,7 @@
143142 lpv_parent_post bigint(10) unsigned null,
144143
145144 -- Signature
146 - lpv_signature TINYBLOB NOT NULL,
147 -
148 - PRIMARY KEY (lpv_id),
149 - KEY (lpv_post, lpv_timestamp)
 145+ lpv_signature TINYBLOB NOT NULL
150146 ) /*$wgDBTableOptions*/;
 147+
 148+CREATE INDEX /*i*/lpv_post_timestamp ON /*_*/lqt_post_version (lpv_post, lpv_timestamp);

Status & tagging log