parameters: (ignore_missing_fn=False)
return_statement: return True
docstring: Enable history tracking globally.
docstring_summary: Enable history tracking globally.
docstring_tokens: Enable history tracking globally .
function: def enable_history_tracking(ignore_missing_fn=False) -> bool:
      """Enable history tracking globally.
      """
      cursor = connection.cursor()
      if ignore_missing_fn:
          cursor.execute("""
              SELECT EXISTS(SELECT 1 FROM pg_class
              WHERE relname='catmaid_history_table');""")
          result = cursor.fetchone()
          if not result[0]:
              # If the function does not exist, return silently if the missing
              # function shouldn't be reported
              return False
      cursor.execute("""
          -- Obtain an advisory lock so that this function works also in a parallel
          -- context.
          SELECT pg_advisory_xact_lock(%(lock_id)s::bigint);
          SELECT enable_history_tracking();
      """, {
          'lock_id':  locks.history_update_event_lock
      })
      return True
function_tokens: def enable_history_tracking ( ignore_missing_fn = False ) -> bool : cursor = connection . cursor ( ) if ignore_missing_fn : cursor . execute ( """
              SELECT EXISTS(SELECT 1 FROM pg_class
              WHERE relname='catmaid_history_table');""" ) result = cursor . fetchone ( ) if not result [ 0 ] : # If the function does not exist, return silently if the missing # function shouldn't be reported return False cursor . execute ( """
          -- Obtain an advisory lock so that this function works also in a parallel
          -- context.
          SELECT pg_advisory_xact_lock(%(lock_id)s::bigint);
          SELECT enable_history_tracking();
      """ , { 'lock_id' : locks . history_update_event_lock } ) return True