-
refer-docs:https://knexjs.org/
-
You can also use KnexCli to genearate migration and configuration setup:
install knex globally :
npm install knex -g
knex init
or
npx knex init
- Install Dependencies:
npm install
- Start the Server :
npm install
- Migrate to PostgresSQL
- npx knex migrate:latest --knexfile db/knexfile
npm run migrate
- Seed to PostgresSQL
- npx knex seed:run latest --knexfile db/knexfile
npm run seed
** Replace db > knexfile database configuration it's my personal profile credentials