refactoring
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- Remove the erroneous UNIQUE constraint on ongoing_timers.project_id.
|
||||
-- Multiple users must be able to have concurrent timers on the same project.
|
||||
-- The one-timer-per-user constraint is correctly enforced by the UNIQUE on user_id.
|
||||
DROP INDEX IF EXISTS "ongoing_timers_project_id_key";
|
||||
@@ -51,7 +51,7 @@ model Project {
|
||||
client Client @relation(fields: [clientId], references: [id], onDelete: Cascade)
|
||||
|
||||
timeEntries TimeEntry[]
|
||||
ongoingTimer OngoingTimer?
|
||||
ongoingTimers OngoingTimer[]
|
||||
|
||||
@@index([userId])
|
||||
@@index([clientId])
|
||||
@@ -85,7 +85,7 @@ model OngoingTimer {
|
||||
|
||||
userId String @map("user_id") @db.VarChar(255) @unique
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
projectId String? @unique @map("project_id")
|
||||
projectId String? @map("project_id")
|
||||
project Project? @relation(fields: [projectId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@index([userId])
|
||||
|
||||
Reference in New Issue
Block a user