-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29420cc
commit a72038e
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ yarn-error.log* | |
|
||
# local env files | ||
.env*.local | ||
.env | ||
|
||
# vercel | ||
.vercel | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
name String | ||
posts Post[] @relation("authored") | ||
comments Comment[] | ||
likedPosts Post[] @relation("liked") | ||
pods PodMember[] | ||
createdPods Pod[] | ||
} | ||
|
||
model Post { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
title String @db.VarChar(255) | ||
content String | ||
author User @relation("authored", fields: [authorId], references: [id]) | ||
authorId Int | ||
comments Comment[] | ||
likedBy User[] @relation("liked") | ||
} | ||
|
||
model Comment { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
content String | ||
author User @relation(fields: [authorId], references: [id]) | ||
authorId Int | ||
post Post @relation(fields: [postId], references: [id]) | ||
postId Int | ||
} | ||
|
||
model Pod { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
name String | ||
members PodMember[] | ||
createdBy User @relation(fields: [creatorId], references: [id]) | ||
creatorId Int | ||
} | ||
|
||
// Many-to-many relationship between Users and Pods | ||
model PodMember { | ||
memberId Int | ||
member User @relation(fields: [memberId], references: [id]) | ||
podId Int | ||
pod Pod @relation(fields: [podId], references: [id]) | ||
dateJoined DateTime @default(now()) | ||
@@id([memberId, podId]) | ||
} |