         callWhenEnded()
 
 
+
+
+
+
+
+
+
+
+
+  (callWhenEnded) ->
+    console.log "> Ensure aiddata commitments indices"
+    
+    indices = [
+      { aiddata_id : 1 }
+      { origin : 1 }
+      { dest : 1 }
+      { origin : 1, dest : 1 }
+      { coalesced_purpose_code : 1 }
+    ]
+    ensureIndices 'aiddata', indices, callWhenEnded
+
+
+
+  (callWhenEnded) ->
+    console.log "> Ensure locations indices"    
+    indices = [
+      { code : 1 }
+    ]
+    ensureIndices 'locations', indices, callWhenEnded
 
 
 





queue = require('queue-async')

runTasksSerially = (tasks, callWhenEnded) ->
  q = queue(1)  # no parallelism



          os.mkdir TEMP_DIR
          fd = fs.openSync(PATH + LOCATIONS_TEMP_FILE, 'w')
          for r in result.rows
            fs.writeSync fd, JSON.stringify(r) + "\n"
          fs.closeSync fd
