'use strict'; const faker = require ('faker'); function create_log () { const data = { num1: faker.random.number (), num2: faker.random.number (), num3: faker.random.number () }; return { app: faker.random.word (), message: faker.random.words (), data: JSON.stringify (data), timestamp: faker.date.recent () }; } async function seed (knex) { console.log ('creating seeds'); const log = (Array (100)) .fill (() => null) .map (() => create_log ()); await knex ('log') .del (); await knex.batchInsert ('log', log, 10); } module.exports = { seed };