use another .env file, else things get too complicated since production and dev .env's are no longer compatible to eachother

This commit is contained in:
Ulf Gebhardt 2021-09-21 19:18:08 +02:00
parent cebf92c451
commit f9a40be539
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
4 changed files with 7 additions and 8 deletions

View File

@ -4,7 +4,4 @@ DB_USER=root
DB_PASSWORD=
DB_DATABASE=gradido_community
MIGRATIONS_TABLE=migrations
// This value is set to the default for the built version.
// Therefore you need to overwrite this when using the dev version
// MIGRATIONS_DIRECTORY=./migrations/
MIGRATIONS_DIRECTORY=./build/migrations/
MIGRATIONS_DIRECTORY=./migrations/

2
database/build/.env.dist Normal file
View File

@ -0,0 +1,2 @@
// For production you need to put your env file in here.
// Please copy the dist file from the root folder in here and rename it to .env

View File

@ -10,9 +10,9 @@
"scripts": {
"build": "tsc --build",
"clean": "tsc --build --clean",
"up": "node build/src/index.js up",
"down": "node build/src/index.js down",
"reset": "node build/src/index.js reset",
"up": "cd build && node src/index.js up",
"down": "cd build && node src/index.js down",
"reset": "cd build && node src/index.js reset",
"dev_up": "nodemon -w ./ --ext ts --exec ts-node src/index.ts up",
"dev_down": "nodemon -w ./ --ext ts --exec ts-node src/index.ts down",
"dev_reset": "nodemon -w ./ --ext ts --exec ts-node src/index.ts reset",

View File

@ -13,7 +13,7 @@ const database = {
const migrations = {
MIGRATIONS_TABLE: process.env.MIGRATIONS_TABLE || 'migrations',
MIGRATIONS_DIRECTORY: process.env.MIGRATIONS_DIRECTORY || './build/migrations/',
MIGRATIONS_DIRECTORY: process.env.MIGRATIONS_DIRECTORY || './migrations/',
}
const CONFIG = { ...database, ...migrations }