From 13e24154beb0564283cb6571e55303af2ea86f11 Mon Sep 17 00:00:00 2001 From: jc user Date: Tue, 22 Oct 2024 10:09:59 +0100 Subject: [PATCH] Update README.md updated the formatting --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f1e2a0..6bb3030 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ npx knex init A 'knexfile.js' will be created in this directory. -Change the file extension to .cjs +> Change the file extension to .cjs you will need to add the below line in your package.json file: @@ -37,22 +37,32 @@ create 2 subfolders inside 'db' folder, called "migrations" and "seeds" This file should be placed in the project root directory +``` + DEV_USER= DEV_DB= DEV_PASSWORD= DEV_HOST=localhost DEV_PORT=5432 +``` + # knexfile.cjs configuration > check current working directory +``` const dir = process.cwd(); +``` + > check current running environment +``` const env = process.env.ENVIRONMENT || ""; +``` + > the database details here ``` @@ -71,7 +81,7 @@ knex migrate:make create_XYZ_table --migrations-directory migrations ``` -make sure to rename the file extensions to .cjs +> make sure to rename the file extensions to .cjs execute migration type: