Update README.md
updated the formatting
This commit is contained in:
parent
77ee8b1d66
commit
13e24154be
14
README.md
14
README.md
|
@ -21,7 +21,7 @@ npx knex init
|
||||||
|
|
||||||
A 'knexfile.js' will be created in this directory.
|
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:
|
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
|
This file should be placed in the project root directory
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
DEV_USER=
|
DEV_USER=
|
||||||
DEV_DB=
|
DEV_DB=
|
||||||
DEV_PASSWORD=
|
DEV_PASSWORD=
|
||||||
DEV_HOST=localhost
|
DEV_HOST=localhost
|
||||||
DEV_PORT=5432
|
DEV_PORT=5432
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
# knexfile.cjs configuration
|
# knexfile.cjs configuration
|
||||||
|
|
||||||
> check current working directory
|
> check current working directory
|
||||||
|
|
||||||
|
```
|
||||||
const dir = process.cwd();
|
const dir = process.cwd();
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
> check current running environment
|
> check current running environment
|
||||||
|
|
||||||
|
```
|
||||||
const env = process.env.ENVIRONMENT || "";
|
const env = process.env.ENVIRONMENT || "";
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
> the database details here
|
> 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:
|
execute migration type:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user