Skip to content

Commit

Permalink
Create Social Table (#122)
Browse files Browse the repository at this point in the history
* first

* added userlink too

* edited to comments

* changed ID

* rm user direct link

---------

Co-authored-by: Andre <andre.timo.landgraf@gmail.com>
  • Loading branch information
eiffelwong1 and andrelandgraf committed Apr 17, 2024
1 parent ef1f7f5 commit 7b260fb
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ datasource db {
}

model User {
id String @id @default(uuid())
email String @unique
id String @id @default(uuid())
email String @unique
name String
currentChallenge String?
password Password?
events Event[]
socialLinks UserSocialLink[]
authenticators Authenticator[]
user_groups UserGroup[]
}
Expand All @@ -41,15 +42,43 @@ model Authenticator {
}

model Group {
id String @id @default(uuid())
id String @id @default(uuid())
name String
description String @db.Text
description String @db.Text
imgAlt String?
imgUrl String?
events Event[]
socalLinks GroupSocialLink[]
user_groups UserGroup[]
}

enum SocalLinkType {
FACEBOOK
TWITTER
INSTAGRAM
LINKEDIN
DISCORD
WEBSITE
}

model GroupSocialLink {
groupId String
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
type SocalLinkType
url String
@@id([groupId, type])
}

model UserSocialLink {
userId String
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
type SocalLinkType
url String
@@id([userId, type])
}

model UserGroup {
userId String
groupId String
Expand Down

0 comments on commit 7b260fb

Please sign in to comment.