]> git.openstreetmap.org Git - osqa.git/commitdiff
Forces the FTS reindexing after an import.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 28 Jun 2010 10:55:50 +0000 (10:55 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 28 Jun 2010 10:55:50 +0000 (10:55 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@455 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/sximporter/importer.py

index 5277b8dd3720fa83bf68650e5d2a8288a11d05b6..2d8c903c1f1125e1a9406b9ff694cacb451acfb7 100644 (file)
@@ -854,6 +854,13 @@ def reset_sequences():
         db.execute_many(PG_SEQUENCE_RESETS)
         db.commit_transaction()
 
+def reindex_fts():
+    from south.db import db
+    if db.backend_name == "postgres":
+        db.start_transaction()
+        db.execute_many("UPDATE forum_node_revision set id = id WHERE TRUE;")
+        db.commit_transaction()
+
 
 def sximport(dump, options):
     try:
@@ -890,6 +897,7 @@ def sximport(dump, options):
 
     if triggers_disabled:
         enable_triggers()
+        reindex_fts()
 
 
 PG_DISABLE_TRIGGERS = """