app/models/page.rb
# Occasionally you'll see "NO NAME" for some page IDs (in searches, associations, collections, and so on), and this
# can be caused by the native_node_id being set to a node that no longer exists. You should try and track down the
# source of that problem, but this code can be used to (slowly) fix the problem, where it's possible to do so:
Occasionally you'll see "NO NAME" for some page IDs (in searches, associations, collections, and so on), and this
can be caused by the native_node_id being set to a node that no longer exists. You should try and track down the
source of that problem, but this code can be used to (slowly) fix the problem, where it's possible to do so.
Occasionally you ' ll see " NO NAME " for some page IDs ( in searches associations collections and so on ) and this can be caused by the native_node_id being set to a node that no longer exists . You should try and track down the source of that problem but this code can be used to ( slowly ) fix the problem where it ' s possible to do so .
def fix_all_missing_native_nodes
      log_healing(">> fix_all_missing_native_nodes")
      start = 1 
      upper = maximum(:id)
      batch_size = 10_000
      while start < upper
        log_healing(">> fix_missing_native_nodes(start = #{start})")
        fix_missing_native_nodes(where("pages.id >= #{start} AND pages.id < #{start + batch_size}"))
        start += batch_size
      end
      log_healing("<< DONE: fix_all_missing_native_nodes")
    end
def fix_all_missing_native_nodes log_healing ( ">> fix_all_missing_native_nodes" ) start = 1 upper = maximum ( :id ) batch_size = 10_000 while start < upper log_healing ( ">> fix_missing_native_nodes(start = #{start})" ) fix_missing_native_nodes ( where ( "pages.id >= #{start} AND pages.id < #{start + batch_size}" ) ) start += batch_size end log_healing ( "<< DONE: fix_all_missing_native_nodes" ) end
Occasionally you'll see "NO NAME" for some page IDs (in searches, associations, collections, and so on), and this
can be caused by the native_node_id being set to a node that no longer exists.
Occasionally you ' ll see " NO NAME " for some page IDs ( in searches associations collections and so on ) and this can be caused by the native_node_id being set to a node that no longer exists .
# Don't bother checking minimum, this is always 1.