diff --git a/readme.md b/readme.md index 3cec354..2a271e1 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@

- Issues + License Tweet

diff --git a/src/db/seeds/dev/seed_notes.js b/src/db/seeds/dev/seed_notes.js index 17a28a7..ff2fdd1 100644 --- a/src/db/seeds/dev/seed_notes.js +++ b/src/db/seeds/dev/seed_notes.js @@ -2,6 +2,9 @@ //in the knex seed/migrate command. Knex will error out if it is not specified. if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') } +//We don't want seeds to run in production +if (process.env.NODE_ENV === 'production') { throw new Error('Can\'t run seeds in production') } + const faker = require('faker') exports.seed = async function(knex, Promise) { diff --git a/src/db/seeds/dev/seed_users.js b/src/db/seeds/dev/seed_users.js index bd5f52b..5002ceb 100644 --- a/src/db/seeds/dev/seed_users.js +++ b/src/db/seeds/dev/seed_users.js @@ -2,14 +2,13 @@ //in the knex seed/migrate command. Knex will error out if it is not specified. if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') } +//We don't want seeds to run in production +if (process.env.NODE_ENV === 'production') { throw new Error('Can\'t run seeds in production') } + const faker = require('faker') const bcrypt = require('bcrypt') exports.seed = async function(knex, Promise) { - //I only want migrations, rollbacks, and seeds to run when the NODE_ENV is specified - //in the knex seed/migrate command - if (!process.env.NODE_ENV) { return; } - //Make 10 users using faker. Note: we're also bcrypting //the passwords to make it exactly like the real app. All their //passwords will be 'secret'