the-road-to-graphql / fullstack-apollo-express-postgresql-boilerplate

💥 A sophisticated GraphQL with Apollo, Express and PostgreSQL boilerplate project.
https://roadtoreact.com
MIT License
1.2k stars 265 forks source link

Do not wipe database in production #55

Open morenoh149 opened 5 years ago

morenoh149 commented 5 years ago

If the DATABASE_URL env var is defined we act like we are in production. When we are in production we wipe the db if the api restarts.

  1. env var DATABASE_URL should not imply production
  2. do not wipe db if we are in production
  3. factor out the seeding step into a separate file while we are at it.

Relevant code https://github.com/the-road-to-graphql/fullstack-apollo-express-postgresql-boilerplate/blob/master/src/index.js#L94

rwieruch commented 5 years ago

Related https://github.com/the-road-to-graphql/fullstack-apollo-express-postgresql-boilerplate/pull/54