feat: add PostgreSQL database adapter support

This commit is contained in:
2026-03-29 20:08:53 -07:00
parent 54fd6abb5e
commit 803f936e2f
8 changed files with 393 additions and 6 deletions
+23
View File
@@ -85,6 +85,29 @@ If users are redirected incorrectly or permissions aren't working:
3. Run `npx prisma generate`
4. Update affected API routes and components
### Database Provider Switching
The application supports both SQLite (default) and PostgreSQL databases.
**To switch between databases:**
```bash
# Switch to SQLite
npm run db:switch sqlite
# Switch to PostgreSQL
npm run db:switch postgresql
```
**To set up PostgreSQL:**
```bash
npm run db:setup-postgres
```
**Database Configuration:**
- Edit `.env` file to set `DATABASE_PROVIDER` and `DATABASE_URL`
- For PostgreSQL, also set `DATABASE_SHADOW_URL` for migrations
**Note:** The database provider is automatically detected by Better Auth and Prisma.
### Running Tests
- **Unit tests**: `npm run test`
- **Acceptance tests**: `npm run test:acceptance`