env
folder in the root project folderenv/.env.development
and env/.env.production
filesdevelopment
and production
. \
Make sure POSTGRES_PASSWORD variable is changed.npm run dc:dev
\
Production environment: npm run dc:prod
Dev environment only:
Apply: npm run db:migrate
\
Undo: npm run db:migrate:undo
To create a new migration please use:
npx sequelize-cli migration:create --name=<MIGRATION_NAME
Dev environment only:
Apply: npm run db:seed:all
\
Undo: npm run db:seed:undo
Use case: if you need to recreate table with a lot of relations.
docker volume ls
docker volume rm online-school-app_pg-data
npm run dc:dev
- database will be created from scratchIf it's the first run please execute the command: npm run db:seed:all
It'll create all data needed for tests.
Dev mode: npm test
CI mode: npm run test:nowatch
UserRoles
enum in user modelInitialDbSeed
function on app startTo covert DOCS.md to pdf please do the following:
npm i -g md-to-pdf
cat DOCS.md | md-to-pdf > ./pdf/online-school-api-docs.pdf
Please do not add PDF file to git.