From 16812e0966084128e665f53bed281c9c0e562eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 20 Jul 2022 07:56:43 +0200 Subject: [PATCH] Disallow database seeding in non-staging and real production environments --- backend/src/db/seed.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js index 7bfd4f159..92d49e98f 100644 --- a/backend/src/db/seed.js +++ b/backend/src/db/seed.js @@ -6,6 +6,10 @@ import Factory from '../db/factories' import { getNeode, getDriver } from '../db/neo4j' import { gql } from '../helpers/jest' +if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) { + throw new Error(`You cannot seed the database in a non-staging and real production environment!`) +} + const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] /* eslint-disable no-multi-spaces */