Commit af6c0b62 authored by Hendrik Garske's avatar Hendrik Garske

Datenbank: Umstellung von SQLite auf PostgreSQL

parent a2ebe2f9
Pipeline #6 failed with stages
in 20 seconds
......@@ -41,6 +41,10 @@ yarn-error.log*
prisma/dev.db
dev.db
# postgres (local development)
.env.local
.env*.local
# vercel
.vercel
......
......@@ -15,7 +15,7 @@ Internes Dashboard für CoreX Management Mitarbeiter mit Zeiterfassung und Kunde
- **Framework**: Next.js 16.1.1 (App Router)
- **Language**: TypeScript
- **Styling**: Tailwind CSS v4
- **Database**: SQLite mit Prisma ORM
- **Database**: PostgreSQL mit Prisma ORM
- **UI Components**: Radix UI, Lucide Icons
## Getting Started
......@@ -41,7 +41,14 @@ npm install
3. Umgebungsvariablen einrichten:
Erstellen Sie eine `.env` Datei im Root-Verzeichnis:
```env
DATABASE_URL="file:./dev.db"
DATABASE_URL="postgresql://username:password@localhost:5432/corex_dashboard?schema=public"
```
**Datenbank einrichten:**
- Stellen Sie sicher, dass PostgreSQL installiert und laufend ist
- Erstellen Sie eine neue Datenbank:
```sql
CREATE DATABASE corex_dashboard;
```
4. Datenbank initialisieren:
......@@ -88,7 +95,33 @@ Die Anwendung läuft dann auf [http://localhost:3000](http://localhost:3000)
## Datenbank
Das Projekt verwendet Prisma ORM mit SQLite. Die Datenbank-Schema-Definitionen befinden sich in `prisma/schema.prisma`.
Das Projekt verwendet Prisma ORM mit PostgreSQL. Die Datenbank-Schema-Definitionen befinden sich in `prisma/schema.prisma`.
### PostgreSQL Setup
1. **PostgreSQL installieren** (falls nicht vorhanden):
- Windows: https://www.postgresql.org/download/windows/
- macOS: `brew install postgresql`
- Linux: `sudo apt-get install postgresql`
2. **Datenbank erstellen**:
```bash
# PostgreSQL Terminal öffnen
psql -U postgres
# Datenbank erstellen
CREATE DATABASE corex_dashboard;
# Benutzer erstellen (optional, aber empfohlen)
CREATE USER corex_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE corex_dashboard TO corex_user;
\q
```
3. **DATABASE_URL in .env setzen**:
```env
DATABASE_URL="postgresql://corex_user:your_secure_password@localhost:5432/corex_dashboard?schema=public"
```
### Migrationen
......
......@@ -6,7 +6,8 @@ generator client {
}
datasource db {
provider = "sqlite"
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment