mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
add orgid unique constraint to repo
This commit is contained in:
parent
fdd71cfcfe
commit
62e64c1c25
2 changed files with 12 additions and 1 deletions
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[external_id,external_codeHostUrl,orgId]` on the table `Repo` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- DropIndex
|
||||
DROP INDEX "Repo_external_id_external_codeHostUrl_key";
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Repo_external_id_external_codeHostUrl_orgId_key" ON "Repo"("external_id", "external_codeHostUrl", "orgId");
|
||||
|
|
@ -55,7 +55,7 @@ model Repo {
|
|||
org Org @relation(fields: [orgId], references: [id], onDelete: Cascade)
|
||||
orgId Int
|
||||
|
||||
@@unique([external_id, external_codeHostUrl])
|
||||
@@unique([external_id, external_codeHostUrl, orgId])
|
||||
}
|
||||
|
||||
model Connection {
|
||||
|
|
|
|||
Loading…
Reference in a new issue