From: hernani Date: Tue, 25 May 2010 12:36:13 +0000 (+0000) Subject: FTS triggers update. X-Git-Tag: live~804 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/178a88bfeb53a6b9520c74c10eea42073098902b?ds=sidebyside FTS triggers update. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@327 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum_modules/pgfulltext/pg_fts_install.sql b/forum_modules/pgfulltext/pg_fts_install.sql index 4161fd8..5d5d9b8 100644 --- a/forum_modules/pgfulltext/pg_fts_install.sql +++ b/forum_modules/pgfulltext/pg_fts_install.sql @@ -59,10 +59,10 @@ begin setweight(to_tsvector('english', coalesce(body,'')), 'C') INTO doc FROM forum_node WHERE id = root_id; - SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND deleted_id IS NULL; + SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%'); IF rcount > 0 THEN - FOR cv in SELECT setweight(to_tsvector('english', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id AND deleted_id IS NULL LOOP + FOR cv in SELECT setweight(to_tsvector('english', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%') LOOP doc :=(doc || cv); END LOOP; END IF; diff --git a/forum_modules/pgfulltext/startup.py b/forum_modules/pgfulltext/startup.py index 22f61a8..fc7840b 100644 --- a/forum_modules/pgfulltext/startup.py +++ b/forum_modules/pgfulltext/startup.py @@ -3,7 +3,7 @@ from forum.models import KeyValue from django.db import connection, transaction import settings -VERSION = 8 +VERSION = 9 if int(settings.PG_FTSTRIGGERS_VERSION) < VERSION: f = open(os.path.join(os.path.dirname(__file__), 'pg_fts_install.sql'), 'r')