diff --git a/README.md b/README.md index fb23908050..5a9b546c08 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/packages/realm-server/package.json b/packages/realm-server/package.json index 1be13ae424..9c10714cce 100644 --- a/packages/realm-server/package.json +++ b/packages/realm-server/package.json @@ -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"