summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-11-19 16:25:16 +0100
committerYorhel <git@yorhel.nl>2021-11-19 16:25:16 +0100
commit0ea2fb67930af01fe5f4484615e129a13bd8649b (patch)
tree67a209fb8841e343a4c7dc47424325c0f7e406ba /util
parent0a98d9df12cfc6ea73729b0b3feb3fee52c9f336 (diff)
Use new search for VNs; remove search cache updating from Multi
Diffstat (limited to 'util')
-rwxr-xr-xutil/devdump.pl3
-rw-r--r--util/updates/2021-11-19-vn-search.sql7
2 files changed, 9 insertions, 1 deletions
diff --git a/util/devdump.pl b/util/devdump.pl
index 387e0bb9..2a20544c 100755
--- a/util/devdump.pl
+++ b/util/devdump.pl
@@ -84,7 +84,7 @@ sub copy_entry {
for(@$tables) {
my $add = '';
$add = " AND vid IN($vids)" if /^releases_vn/ || /^vn_relations/ || /^chars_vns/;
- copy $_ => "SELECT * FROM $_ WHERE id IN($ids) $add", $_ eq 'releases' ? { c_search => 'del' } : ();
+ copy $_ => "SELECT * FROM $_ WHERE id IN($ids) $add", { c_search => 'del' };
copy "${_}_hist" => "SELECT x.* FROM ${_}_hist x JOIN changes c ON c.id = x.chid WHERE c.itemid IN($ids) $add";
}
}
@@ -182,6 +182,7 @@ sub copy_entry {
print "SELECT update_vnvotestats();\n";
print "SELECT update_users_ulist_stats(NULL);\n";
print "SELECT update_images_cache(NULL);\n";
+ print "UPDATE vn SET c_search = search_gen_vn(id);\n";
print "UPDATE users u SET c_tags = (SELECT COUNT(*) FROM tags_vn v WHERE v.uid = u.id);\n";
print "UPDATE users u SET c_changes = (SELECT COUNT(*) FROM changes c WHERE c.requester = u.id);\n";
diff --git a/util/updates/2021-11-19-vn-search.sql b/util/updates/2021-11-19-vn-search.sql
new file mode 100644
index 00000000..56ce6661
--- /dev/null
+++ b/util/updates/2021-11-19-vn-search.sql
@@ -0,0 +1,7 @@
+DROP TRIGGER vn_vnsearch_notify ON vn;
+DROP FUNCTION vn_vnsearch_notify();
+\i sql/func.sql
+
+-- Warning: slow
+\timing
+UPDATE vn SET c_search = search_gen_vn(id);