forked from Cavemanon/cavepaintings
PostgreSQL does not support INDEX() inside the CREATE TABLE method. You must create the index as a separate query. Fortunately MySQL also support this way of doing things as well.
This commit is contained in:
@@ -80,12 +80,12 @@ class CommentList extends Extension {
|
||||
owner_ip SCORE_INET NOT NULL,
|
||||
posted DATETIME DEFAULT NULL,
|
||||
comment TEXT NOT NULL,
|
||||
INDEX (image_id),
|
||||
INDEX (owner_ip),
|
||||
INDEX (posted),
|
||||
FOREIGN KEY (image_id) REFERENCES images(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT
|
||||
");
|
||||
$database->execute("CREATE INDEX comments_image_id_idx ON comments(image_id)", array());
|
||||
$database->execute("CREATE INDEX comments_owner_id_idx ON comments(owner_id)", array());
|
||||
$database->execute("CREATE INDEX comments_posted_idx ON bookmark(posted)", array());
|
||||
$config->set_int("ext_comments_version", 3);
|
||||
}
|
||||
|
||||
@@ -97,9 +97,9 @@ class CommentList extends Extension {
|
||||
owner_id INTEGER NOT NULL,
|
||||
owner_ip CHAR(16) NOT NULL,
|
||||
posted DATETIME DEFAULT NULL,
|
||||
comment TEXT NOT NULL,
|
||||
INDEX (image_id)
|
||||
comment TEXT NOT NULL
|
||||
");
|
||||
$database->execute("CREATE INDEX comments_image_id_idx ON comments(image_id)", array());
|
||||
$config->set_int("ext_comments_version", 1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user