Skip to content

Commit

Permalink
Merge pull request #69 from codex-team/migrate-dev
Browse files Browse the repository at this point in the history
Revert migrate command in package.json back to dev
  • Loading branch information
n0str authored Oct 20, 2023
2 parents 0e2f44c + 4c8078c commit a285954
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@ services:
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: example
POSTGRES_USER: codex
POSTGRES_DB: notes
POSTGRES_PASSWORD: postgres
ports:
- 127.0.0.1:5432:5432
volumes:
- ./database:/var/lib/postgresql/data
```

To run it execute: `docker compose up -d postgres` where `-d` is used for background run.
If you have outdated version of docker, try use `docker-compose` instead of `docker compose` (https://docs.docker.com/compose/)
If you have outdated version of docker, try use `docker-compose` instead of `docker compose` (https://docs.docker.com/compose/).

To flush the database, just delete the `database` folder and restart the container:
```
rm -rf database
docker compose down
docker compose up -d postgres
```

## Running application in development mode

Expand Down
2 changes: 1 addition & 1 deletion init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -e
node --loader ts-node/esm dist/repository/storage/postgres/migrations/index.js -c app-config.yaml
node dist/repository/storage/postgres/migrations/index.js -c app-config.yaml
node dist/index.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dev": "nodemon --watch './src/**/*.ts' --ext ts --exec 'npm run start:dev'",
"start": "node dist/index.js -c app-config.yaml -c app-config.local.yaml",
"start:dev": "npm run build && node dist/index.js -c app-config.yaml -c app-config.local.yaml",
"migrate": "node --loader ts-node/esm dist/repository/storage/postgres/migrations/index.js -c app-config.yaml -c app-config.local.yaml",
"migrate": "node --loader ts-node/esm ./src/repository/storage/postgres/migrations/index.ts -c app-config.yaml -c app-config.local.yaml",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"test": "vitest",
Expand Down

0 comments on commit a285954

Please sign in to comment.