async createFilesRecord (driverId, storageDataList) {
    // TODO: optimize
    logger.debug('Creating file record', storageDataList)

    const fileIds = {}

    let result = db('files').where('driverId', driverId).andWhere((builder) => {
      builder.where('storageData', storageDataList[0])

      for (const i in storageDataList) {
        const item = storageDataList[i]
        if (i === 0) continue
        builder.orWhere('storageData', item)
      }
    })

    result = await result.select('id', 'storageData')

    for (const i in result) {
      fileIds[result[i].storageData] = result[i].id
    }

    const oriKeys = storageDataList
    const nowKeys = Object.keys(fileIds)

    storageDataList = oriKeys.filter(o => {
      return nowKeys.indexOf(o) === -1
    })

    const insertData = []
    for (const i in storageDataList) {
      insertData.push({
        driverId: driverId,
        storageData: storageDataList[i],
        updateTime: (new Date()).getTime()
      })
    }

    result = await db('files').insert(insertData)

    if (result) {
      result = db('files').where('driverId', driverId).where('storageData', storageDataList[0])
      for (const i in storageDataList) {
        const item = storageDataList[i]
        if (i === 0) continue
        result = result.orWhere('storageData', item)
      }
      result = await result.select('id', 'storageData')

      for (const i in result) {
        fileIds[result[i].storageData] = result[i].id
      }
    }

    return fileIds
  }
Create or get a record of file

@param {Int} driverId
@param {Array} storageDataList

@returns {Object} File ids