remove xmldb stuff from comment too...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@853 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
9026856a91
commit
d5b21bf8f2
@ -144,8 +144,40 @@ class CommentList extends Extension {
|
|||||||
global $database;
|
global $database;
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
// shortcut to latest
|
||||||
if($config->get_int("ext_comments_version") < 1) {
|
if($config->get_int("ext_comments_version") < 1) {
|
||||||
$database->upgrade_schema("ext/comment/schema.xml");
|
$database->Execute("CREATE TABLE comments (
|
||||||
|
id {$database->engine->auto_increment},
|
||||||
|
image_id INTEGER NOT NULL,
|
||||||
|
owner_id INTEGER NOT NULL,
|
||||||
|
owner_ip CHAR(16) NOT NULL,
|
||||||
|
posted DATETIME DEFAULT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
INDEX (image_id),
|
||||||
|
INDEX (owner_ip),
|
||||||
|
INDEX (posted)
|
||||||
|
) {$database->engine->create_table_extras}");
|
||||||
|
$config->set_int("ext_comments_version", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===
|
||||||
|
if($config->get_int("ext_comments_version") < 1) {
|
||||||
|
$database->Execute("CREATE TABLE comments (
|
||||||
|
id {$database->engine->auto_increment},
|
||||||
|
image_id INTEGER NOT NULL,
|
||||||
|
owner_id INTEGER NOT NULL,
|
||||||
|
owner_ip CHAR(16) NOT NULL,
|
||||||
|
posted DATETIME DEFAULT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
INDEX (image_id)
|
||||||
|
) {$database->engine->create_table_extras}");
|
||||||
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }}}
|
// }}}
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<schema version="0.3">
|
|
||||||
<!-- FIXME: mysql utf8ness -->
|
|
||||||
<table name="comments">
|
|
||||||
<field name="id" type="I"><key/><autoincrement/></field>
|
|
||||||
<field name="image_id" type="I"><notnull/></field><!-- references -->
|
|
||||||
<field name="owner_id" type="I"><notnull/></field><!-- references -->
|
|
||||||
<field name="owner_ip" type="C" size="15"><notnull/></field>
|
|
||||||
<field name="posted" type="T"><notnull/></field>
|
|
||||||
<field name="comment" type="X" size="4000"><notnull/></field>
|
|
||||||
<index name="comments__image_id"><col>image_id</col></index>
|
|
||||||
<index name="comments__owner_ip"><col>owner_ip</col></index>
|
|
||||||
<index name="comments__posted"><col>posted</col></index>
|
|
||||||
<opt platform="mysql">DEFAULT CHARSET='utf8'</opt>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<sql>
|
|
||||||
<query>DELETE FROM config WHERE name='ext_comments_version'</query>
|
|
||||||
<query>INSERT INTO config(name, value) VALUES('ext_comments_version', 3)</query>
|
|
||||||
</sql>
|
|
||||||
</schema>
|
|
Loading…
x
Reference in New Issue
Block a user