Skip to content

Commit 366b07c

Browse files
authored
Merge pull request #58 from adgator101/develop
Update Schema
2 parents 7269fdb + 03b9e01 commit 366b07c

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[github_username]` on the table `contributors` will be added. If there are existing duplicate values, this will fail.
5+
- A unique constraint covering the columns `[project_id,contributor_id]` on the table `project_contributors` will be added. If there are existing duplicate values, this will fail.
6+
7+
*/
8+
-- CreateIndex
9+
CREATE UNIQUE INDEX "contributors_github_username_key" ON "public"."contributors"("github_username");
10+
11+
-- CreateIndex
12+
CREATE UNIQUE INDEX "project_contributors_project_id_contributor_id_key" ON "public"."project_contributors"("project_id", "contributor_id");
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `deleted_at` on the `event_images` table. All the data in the column will be lost.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "public"."event_images" DROP COLUMN "deleted_at",
9+
ADD COLUMN "public_id" TEXT;

prisma/schema/schema.prisma

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ model Contributor {
109109
id String @id @default(uuid())
110110
name String
111111
avatarUrl String? @map("avatar_url")
112-
githubUsername String? @map("github_username")
112+
githubUsername String? @map("github_username") @unique
113113
ProjectContributors ProjectContributors[]
114114
115115
@@map("contributors")
@@ -122,6 +122,7 @@ model ProjectContributors {
122122
contributor Contributor @relation(fields: [contributorId], references: [id], onDelete: Cascade)
123123
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
124124
125+
@@unique([projectId, contributorId])
125126
@@map("project_contributors")
126127
}
127128

0 commit comments

Comments
 (0)