es2015/migration/ObjectStoreMigrator.js
function createIndex(objectStore, indexSchema) {
  let indexNames = Array.from(objectStore.indexNames)

  if (indexNames.indexOf(indexSchema.name) !== -1) {
    return
  }

  objectStore.createIndex(indexSchema.name, indexSchema.keyPath, {
    unique: indexSchema.unique,
    multiEntry: indexSchema.multiEntry
  })
}
function createIndex(objectStore, indexSchema) {
  let indexNames = Array.from(objectStore.indexNames)

  if (indexNames.indexOf(indexSchema.name) !== -1) {
    return
  }

  objectStore.createIndex(indexSchema.name, indexSchema.keyPath, {
    unique: indexSchema.unique,
    multiEntry: indexSchema.multiEntry
  })
}
Creates a new index in the provided object store according to the provided
index schema.

@param {IDBObjectStore} objectStore The native Indexed DB object store.
@param {IndexSchema} indexSchema The schema of the index to create.