Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
Web-CoreX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hendrik Garske
Web-CoreX
Commits
af6c0b62
Commit
af6c0b62
authored
Dec 27, 2025
by
Hendrik Garske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Datenbank: Umstellung von SQLite auf PostgreSQL
parent
a2ebe2f9
Pipeline
#6
failed with stages
in 20 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
.gitignore
.gitignore
+4
-0
README.md
README.md
+36
-3
schema.prisma
prisma/schema.prisma
+2
-1
No files found.
.gitignore
View file @
af6c0b62
...
@@ -41,6 +41,10 @@ yarn-error.log*
...
@@ -41,6 +41,10 @@ yarn-error.log*
prisma/dev.db
prisma/dev.db
dev.db
dev.db
# postgres (local development)
.env.local
.env*.local
# vercel
# vercel
.vercel
.vercel
...
...
README.md
View file @
af6c0b62
...
@@ -15,7 +15,7 @@ Internes Dashboard für CoreX Management Mitarbeiter mit Zeiterfassung und Kunde
...
@@ -15,7 +15,7 @@ Internes Dashboard für CoreX Management Mitarbeiter mit Zeiterfassung und Kunde
-
**Framework**
: Next.js 16.1.1 (App Router)
-
**Framework**
: Next.js 16.1.1 (App Router)
-
**Language**
: TypeScript
-
**Language**
: TypeScript
-
**Styling**
: Tailwind CSS v4
-
**Styling**
: Tailwind CSS v4
-
**Database**
:
SQLite
mit Prisma ORM
-
**Database**
:
PostgreSQL
mit Prisma ORM
-
**UI Components**
: Radix UI, Lucide Icons
-
**UI Components**
: Radix UI, Lucide Icons
## Getting Started
## Getting Started
...
@@ -41,7 +41,14 @@ npm install
...
@@ -41,7 +41,14 @@ npm install
3.
Umgebungsvariablen einrichten:
3.
Umgebungsvariablen einrichten:
Erstellen Sie eine
`.env`
Datei im Root-Verzeichnis:
Erstellen Sie eine
`.env`
Datei im Root-Verzeichnis:
```
env
```
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:
4.
Datenbank initialisieren:
...
@@ -88,7 +95,33 @@ Die Anwendung läuft dann auf [http://localhost:3000](http://localhost:3000)
...
@@ -88,7 +95,33 @@ Die Anwendung läuft dann auf [http://localhost:3000](http://localhost:3000)
## Datenbank
## 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
### Migrationen
...
...
prisma/schema.prisma
View file @
af6c0b62
...
@@ -6,7 +6,8 @@ generator client {
...
@@ -6,7 +6,8 @@ generator client {
}
}
datasource
db
{
datasource
db
{
provider
=
"sqlite"
provider
=
"postgresql"
url
=
env
(
"DATABASE_URL"
)
}
}
model
User
{
model
User
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment