From root directory
$ docker compose up -d --build
Access localhost:8080/chess-backend
to view server status
# Down container
$ docker compose down api
$ docker compose up -d --build api
Ensure that db container is running !!!
Move to database folder
$ cd database
# Install dependencies
$ npm install
# Reset database
$ npm run db:reset
# Create new migration file
$ npm run knex migrate:make <migration_name_file.js>
# Run the migration
$ npm run knex migrate:latest
# Rollback the migration
$ npm run knex migrate:rollback
# Create seed file
$ npm run knex seed:make <seed_name_file.js>
# Run all seed file
$ npm run knex seed:run
# Run specific seed file
$ npm run knex seed:run --specific=<seed-filename.js>
For more information you can read at Knexjs docs