24 lines
484 B
JavaScript
24 lines
484 B
JavaScript
'use strict';
|
|
|
|
const faker = require ('faker');
|
|
|
|
function create_log () {
|
|
return {
|
|
app: faker.random.word (),
|
|
message: faker.random.words (),
|
|
data: faker.random.objectElement (),
|
|
timestamp: faker.date.recent ()
|
|
};
|
|
}
|
|
|
|
async function seed (knex) {
|
|
console.log ('creating seeds');
|
|
for (let i = 0; i < 100; i++) {
|
|
// eslint-disable-next-line no-await-in-loop
|
|
await knex ('log')
|
|
.insert (create_log ());
|
|
}
|
|
}
|
|
|
|
module.exports = { seed };
|