Apply pending migrations during development reloads
This commit is contained in:
@@ -143,8 +143,11 @@ bun run db:migrate
|
||||
```
|
||||
|
||||
Commit the generated `drizzle/` files alongside schema changes. `bun dev` and
|
||||
`bun start` apply pending migrations before starting the server. The initial
|
||||
migration creates the users and sessions tables.
|
||||
`bun start` apply pending migrations before starting the server. Development also
|
||||
checks for pending migrations when the server entrypoint is hot-reloaded, so new
|
||||
routes do not run against an older schema. After adding only migration files,
|
||||
run `bun run db:migrate` or restart `bun dev`. The initial migration creates the
|
||||
users and sessions tables.
|
||||
|
||||
Import `db` from `src/db/index.ts` in backend code to query the database.
|
||||
`GET /api/health` checks the database connection before returning success.
|
||||
|
||||
Reference in New Issue
Block a user