fix: Add unique constraint to team and slug for attributes (#22357)
* Add unique constraint to team and slug * Add migration file
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[teamId,slug]` on the table `Attribute` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- DropIndex
|
||||
DROP INDEX "Attribute_slug_key";
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Attribute_teamId_slug_key" ON "Attribute"("teamId", "slug");
|
||||
@@ -1999,9 +1999,8 @@ model Attribute {
|
||||
|
||||
type AttributeType
|
||||
|
||||
name String
|
||||
slug String @unique
|
||||
|
||||
name String
|
||||
slug String
|
||||
enabled Boolean @default(true)
|
||||
|
||||
usersCanEditRelation Boolean @default(false)
|
||||
@@ -2012,6 +2011,7 @@ model Attribute {
|
||||
isWeightsEnabled Boolean @default(false)
|
||||
isLocked Boolean @default(false)
|
||||
|
||||
@@unique([teamId, slug])
|
||||
@@index([teamId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user