async attachMeta (type, metadataId, name, photoURL) {
    const map = this._getTypeMapping(type)
    logger.debug(map)

    try {
      const id = await this.getMetaId(map.type, name, photoURL)
      logger.debug(`${map.log} id`, id)

      const count = await db(`${map.type}_mapping`).where(map.column, id).where('metadataId', metadataId).count()
      if (count[0]['count(*)'] === 0) {
        logger.debug('Create mapping, count', count, count[0]['count(*)'])

        const data = {
          metadataId,
          updateTime: (new Date()).getTime()
        }
        data[map.column] = id

        await db(`${map.type}_mapping`).insert(data)
      } else {
        logger.debug('Meta exists')
      }
    } catch (error) {
      logger.error('Error while attaching a meta', error)
      throw error
    }
  }
Attach meta to meatdata table

@param {String} type
@param {Int} metadataId
@param {String} name
@param {String=} photoURL photo URL

@return {Int}