try to create fti table if not existant on rebuild-fti stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 02 Jul 2009 15:02:24 +0200
branchstable
changeset 2248 cbf043a2134a
parent 2247 9dbbe6a4c9b0
child 2250 bc6fc4d6bcac
try to create fti table if not existant on rebuild-fti
server/checkintegrity.py
--- a/server/checkintegrity.py	Thu Jul 02 14:51:37 2009 +0200
+++ b/server/checkintegrity.py	Thu Jul 02 15:02:24 2009 +0200
@@ -71,6 +71,14 @@
                                        uniquecstrcheck_before_modification)
     from cubicweb.server.repository import FTIndexEntityOp
     repo = session.repo
+    cursor = session.pool['system']
+    if not repo.system_source.indexer.has_fti_table(cursor):
+        from indexer import get_indexer
+        print 'no text index table'
+        indexer = get_indexer(repo.system_source.dbdriver)
+        # XXX indexer.init_fti(cursor) once index 0.7 is out
+        indexer.init_extensions(cursor)
+        cursor.execute(indexer.sql_init_fti())
     repo.hm.unregister_hook(setmtime_before_update_entity,
                             'before_update_entity', '')
     repo.hm.unregister_hook(uniquecstrcheck_before_modification,