init simple appreports

This commit is contained in:
2020-07-29 20:56:03 +02:00
parent 217775265f
commit 4296f42ee7
24 changed files with 1568 additions and 256 deletions

23
seeds/fake.js Normal file
View File

@ -0,0 +1,23 @@
'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 };