(ignore_missing_fn=False)
return True
Enable history tracking globally.
Enable history tracking globally.
Enable history tracking globally .
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
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