Skip to content

Commit

Permalink
add drop db script
Browse files Browse the repository at this point in the history
  • Loading branch information
habdelra committed Apr 13, 2024
1 parent 93aa170 commit 7d3fa5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ When running tests we isolate the database between each test run by actually cre

If you wish to drop the development database you can execute:
```
docker exec boxel-pg dropdb -U postgres -w boxel
pnpm drop-db
```

You can then run `pnpm migrate up` to create the database again.
You can then run `pnpm migrate up` or start the realm server to create the database again.

#### DB Migrations
When the realm server starts up it will automatically run DB migrations that live in the `packages/realm-server/migrations` folder. As part of development you may wish to run migrations manually as well as to create a new migration.
Expand Down
3 changes: 2 additions & 1 deletion packages/realm-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"lint:js:fix": "eslint . --fix",
"lint:glint": "glint",
"migrate": "PGDATABASE=boxel ./scripts/ensure-db-exists.sh && PGPORT=5435 PGDATABASE=boxel PGUSER=postgres node-pg-migrate",
"make-schema": "./scripts/schema-dump.sh"
"make-schema": "./scripts/schema-dump.sh",
"drop-db": "docker exec boxel-pg dropdb -U postgres -w boxel"
},
"volta": {
"extends": "../../package.json"
Expand Down

0 comments on commit 7d3fa5f

Please sign in to comment.