const _ = require('lodash') const { init, Location } = require('../database') module.exports = async () => { await Location.upsert({ name: 'Los Angeles', key: 'LAX' }), await Location.upsert({ name: 'San Francisco', key: 'SFO' }), await Location.upsert({ name: 'Las Vegas', key: 'LAS' }) return _.chain(await Location.findAll()) .map(o => [o.key, o]) .fromPairs() .value() }