dbHouses database migrations, types and configuration for running a local PostgreSQL instance.
This will start a local PostgreSQL Docker container, run all migrations against it, and seed it:
pnpm exec nx run db:start
This will wipe the local database, re-run all migrations and seed the database:
pnpm exec nx run db:reset
This will explicitly just seed the local database. This will rarely need to be run. You'll more likely want to run reset during development.
pnpm exec nx run db:seed
pnpm exec nx run db:stop
This will generate a blank migration file within the migrations directory.
pnpm exec nx run db:migrate-new <name>
pnpm exec nx run db:migrate-up
pnpm exec nx run db:migrate-down
pnpm exec nx run db:migrate-status
pnpm exec nx run db:migrate-dump
To add seed data to the database, you can create .sql scripts within the seed directory.
Running the start or reset targets on this project will automatically seed the database using these seed scripts.
This data will only be inserted into the local instance.