implemented data sources with prisma in go

This commit is contained in:
2025-01-02 13:19:55 +00:00
parent cfb0bdf9cf
commit 615e749a12
55 changed files with 1399 additions and 788 deletions
Binary file not shown.
+60
View File
@@ -0,0 +1,60 @@
generator goClient {
provider = "go run github.com/steebchen/prisma-client-go"
output = "../internal/infrastructure/data/db"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
// User Model
model UserDbo {
id String @id @default(uuid())
name String
email String @unique
password String
projects ProjectDbo[] // Beziehung zu Projekten
timeEntries TimeEntryDbo[] // Beziehung zu Zeiteinträgen
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// Project Model
model ProjectDbo {
id String @id @default(uuid())
name String
description String?
clientId String?
tasks ProjectTaskDbo[] // Beziehung zu Aufgaben
timeEntries TimeEntryDbo[] // Beziehung zu Zeiteinträgen
user UserDbo @relation(fields: [userId], references: [id])
userId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// TimeEntry Model
model TimeEntryDbo {
id String @id @default(uuid())
startTime DateTime
endTime DateTime?
description String?
user UserDbo @relation(fields: [userId], references: [id])
userId String
project ProjectDbo @relation(fields: [projectId], references: [id])
projectId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// Task Model (optional)
model ProjectTaskDbo {
id String @id @default(uuid())
name String
description String?
project ProjectDbo @relation(fields: [projectId], references: [id])
projectId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}