feat: add PostgreSQL database adapter support
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user