fixes
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const faker = require ('faker');
|
||||
const sn = require ('simplex-noise');
|
||||
|
||||
function create_log () {
|
||||
function create_log (index, simplex) {
|
||||
const data = {
|
||||
num1: faker.random.number (),
|
||||
num2: faker.random.number (),
|
||||
num3: faker.random.number ()
|
||||
num2: simplex.noise2D (index * 0.1, 0),
|
||||
num3: simplex.noise2D (index * 0.1, 1000)
|
||||
};
|
||||
return {
|
||||
app: faker.random.word (),
|
||||
@ -18,9 +19,10 @@ function create_log () {
|
||||
|
||||
async function seed (knex) {
|
||||
console.log ('creating seeds');
|
||||
const simplex = (new sn);
|
||||
const log = (Array (20))
|
||||
.fill (() => null)
|
||||
.map (() => create_log ());
|
||||
.map ((a, index) => create_log (index, simplex));
|
||||
await knex ('log')
|
||||
.del ();
|
||||
|
||||
|
Reference in New Issue
Block a user