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: