comments needs some indexes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@661 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
b2ef2502db
commit
51f8d0891c
@ -61,7 +61,7 @@ class CommentList extends Extension {
|
|||||||
$config->set_default_int('comment_limit', 3);
|
$config->set_default_int('comment_limit', 3);
|
||||||
$config->set_default_int('comment_count', 5);
|
$config->set_default_int('comment_count', 5);
|
||||||
|
|
||||||
if($config->get_int("ext_comments_version") < 1) {
|
if($config->get_int("ext_comments_version") < 2) {
|
||||||
$this->install();
|
$this->install();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,17 +143,26 @@ class CommentList extends Extension {
|
|||||||
protected function install() {
|
protected function install() {
|
||||||
global $database;
|
global $database;
|
||||||
global $config;
|
global $config;
|
||||||
$database->Execute("CREATE TABLE `comments` (
|
|
||||||
`id` int(11) NOT NULL auto_increment,
|
if($config->get_int("ext_comments_version") < 1) {
|
||||||
`image_id` int(11) NOT NULL,
|
$database->Execute("CREATE TABLE `comments` (
|
||||||
`owner_id` int(11) NOT NULL,
|
`id` int(11) NOT NULL auto_increment,
|
||||||
`owner_ip` char(16) NOT NULL,
|
`image_id` int(11) NOT NULL,
|
||||||
`posted` datetime default NULL,
|
`owner_id` int(11) NOT NULL,
|
||||||
`comment` text NOT NULL,
|
`owner_ip` char(16) NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
`posted` datetime default NULL,
|
||||||
KEY `comments_image_id` (`image_id`)
|
`comment` text NOT NULL,
|
||||||
)");
|
PRIMARY KEY (`id`),
|
||||||
$config->set_int("ext_comments_version", 1);
|
KEY `comments_image_id` (`image_id`)
|
||||||
|
)");
|
||||||
|
$config->set_int("ext_comments_version", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($config->get_int("ext_comments_version") == 1) {
|
||||||
|
$database->Execute("CREATE INDEX comments_owner_ip ON comments(owner_ip)");
|
||||||
|
$database->Execute("CREATE INDEX comments_posted ON comments(posted)");
|
||||||
|
$config->set_int("ext_comments_version", 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// }}}
|
// }}}
|
||||||
// page building {{{
|
// page building {{{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user