Changed labels to be unique on the same instance

This commit is contained in:
Judson Cairo
2024-08-12 21:35:31 -03:00
parent dbb6ea9147
commit 48febec36a
3 changed files with 32 additions and 10 deletions

View File

@@ -216,7 +216,7 @@ model Chatwoot {
model Label {
id String @id @default(cuid())
labelId String? @unique @db.VarChar(100)
labelId String? @db.VarChar(100)
name String @db.VarChar(100)
color String @db.VarChar(100)
predefinedId String? @db.VarChar(100)
@@ -224,6 +224,8 @@ model Label {
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
@@unique([labelId, instanceId])
}
model Proxy {