         for self_reference in MODELS.self_references
           do (self_reference) ->
             save_queue.defer (callback) ->
+              self_reference_inverse = MODELS.self_reference_inverses.pop()
+              self_reference_inverse.set({
+                owner: self_reference
+              })
+              self_reference_inverse.save callback
+            save_queue.defer (callback) ->
               self_references = self_reference.get('self_references') or []
               self_references.push MODELS.self_reference_targets.pop()
               self_reference.set({
                 self_references: self_references
               })
               self_reference.save callback
-            save_queue.defer (callback) ->
-              self_reference_inverse = MODELS.self_reference_inverses.pop()
-              self_reference_inverse.set({
-                owner: self_reference
-              })
-              self_reference_inverse.save callback
 
         save_queue.await callback
 

      related_key = 'self_references'
      related_id_accessor = 'self_reference_ids'

      SelfReference.cursor({$one: true}).include(related_key).toModels (err, owner) ->
        assert.ok(!err, "No errors: #{err}")
        assert.ok(owner, 'found model')
        owner_id = owner.id

      queue.defer (callback) -> QueryCache.configure({enabled: !!options.query_cache, verbose: false}).reset(callback) # configure query cache

      # destroy all
      queue.defer (callback) -> Utils.resetSchemas [SelfReference], callback

      # create all
      queue.defer (callback) ->
