server/checkintegrity.py
changeset 9463 d62e13eba033
parent 9171 be9596750678
child 9468 39b7a91a3f4c
equal deleted inserted replaced
9462:375fc1868b11 9463:d62e13eba033
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    97 def reindex_entities(schema, session, withpb=True, etypes=None):
    97 def reindex_entities(schema, session, withpb=True, etypes=None):
    98     """reindex all entities in the repository"""
    98     """reindex all entities in the repository"""
    99     # deactivate modification_date hook since we don't want them
    99     # deactivate modification_date hook since we don't want them
   100     # to be updated due to the reindexation
   100     # to be updated due to the reindexation
   101     repo = session.repo
   101     repo = session.repo
   102     cursor = session.cnxset['system']
   102     cursor = session.cnxset.cu
   103     dbhelper = session.repo.system_source.dbhelper
   103     dbhelper = session.repo.system_source.dbhelper
   104     if not dbhelper.has_fti_table(cursor):
   104     if not dbhelper.has_fti_table(cursor):
   105         print 'no text index table'
   105         print 'no text index table'
   106         dbhelper.init_fti(cursor)
   106         dbhelper.init_fti(cursor)
   107     repo.system_source.do_fti = True  # ensure full-text indexation is activated
   107     repo.system_source.do_fti = True  # ensure full-text indexation is activated