update tag counts after bulk replace
git-svn-id: file:///home/shish/svn/shimmie2/trunk@688 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
c2d9f39e7e
commit
4f58884187
@ -96,6 +96,11 @@ class TagEdit extends Extension {
|
||||
// FIXME: what if the (image_id,tag_id) pair already exists?
|
||||
$database->Execute("UPDATE IGNORE image_tags SET tag_id=? WHERE tag_id=?", Array($replace_id, $search_id));
|
||||
$database->Execute("DELETE FROM image_tags WHERE tag_id=?", Array($search_id));
|
||||
$database->Execute("
|
||||
UPDATE tags
|
||||
SET count=(SELECT COUNT(image_id) FROM image_tags WHERE tag_id=tags.id GROUP BY tag_id)
|
||||
WHERE id=?
|
||||
", array($replace_id));
|
||||
}
|
||||
else if($search_id) {
|
||||
$database->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));
|
||||
|
Loading…
x
Reference in New Issue
Block a user