From c99954bbbface7938e7d8c935bccae74982d5c66 Mon Sep 17 00:00:00 2001 From: vuurball Date: Fri, 24 Jan 2020 16:26:54 +0200 Subject: [PATCH 1/3] Update factory.js added required fields, to match the database table constraints which is made by the built-in seeder. this might help new comers save time figuring out --- database/factory.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/database/factory.js b/database/factory.js index 16b5084..3a5a517 100644 --- a/database/factory.js +++ b/database/factory.js @@ -13,9 +13,12 @@ /** @type {import('@adonisjs/lucid/src/Factory')} */ // const Factory = use('Factory') +// const Hash = use('Hash') -// Factory.blueprint('App/Models/User', (faker) => { +// Factory.blueprint('App/Models/User', async (faker) => { // return { -// username: faker.username() +// username: faker.username(), +// email: faker.email(), +// password: await Hash.make(faker.password()) // } // }) From 9a34b80959bb26450f0464b7dd060a3815ad3b25 Mon Sep 17 00:00:00 2001 From: vuurball Date: Fri, 24 Jan 2020 17:12:04 +0200 Subject: [PATCH 2/3] Update factory.js removed the hashing of a password because it's done behind the scenes --- database/factory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/factory.js b/database/factory.js index 3a5a517..5017d21 100644 --- a/database/factory.js +++ b/database/factory.js @@ -15,10 +15,10 @@ // const Factory = use('Factory') // const Hash = use('Hash') -// Factory.blueprint('App/Models/User', async (faker) => { +// Factory.blueprint('App/Models/User', (faker) => { // return { // username: faker.username(), // email: faker.email(), -// password: await Hash.make(faker.password()) +// password: faker.password() // } // }) From b0267f6cd98bd794c3080a9e749b65627689e0dc Mon Sep 17 00:00:00 2001 From: vuurball Date: Fri, 24 Jan 2020 17:17:43 +0200 Subject: [PATCH 3/3] removed hashing password --- database/factory.js | 1 - 1 file changed, 1 deletion(-) diff --git a/database/factory.js b/database/factory.js index 5017d21..d0cedc5 100644 --- a/database/factory.js +++ b/database/factory.js @@ -13,7 +13,6 @@ /** @type {import('@adonisjs/lucid/src/Factory')} */ // const Factory = use('Factory') -// const Hash = use('Hash') // Factory.blueprint('App/Models/User', (faker) => { // return {