Skip to content

Commit

Permalink
changed: schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Celesca committed Nov 24, 2024
1 parent d23622b commit ce7d50c
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ model User {
ProfileImage String?
Bio String?
AverageRating Float? // Calculated from UserRating
PersonalType PersonalType @relation(fields: [PersonalTypeID], references: [PersonalTypeID])
PersonalTypeID Int
CreatedAt DateTime @default(now())
UpdatedAt DateTime @default(now()) @updatedAt
MessagesSent Message[] @relation("MessagesSent")
Expand All @@ -33,7 +35,6 @@ model User {
UserTeams UserTeam[] // Relation to UserTeam (many-to-many with Teams)
RatingsGiven UserRating[] @relation("RatingsGiven") // Ratings this user has given
RatingsReceived UserRating[] @relation("RatingsReceived") // Ratings this user has received
UserPersonal UserPersonal[] // Relation to UserPersonal
}

model UserRating {
Expand Down Expand Up @@ -125,17 +126,9 @@ model UserTeam {
JoinedAt DateTime @default(now())
}

model Personal {
PersonalID Int @id
PersonalType String // Type of personal information (e.g., Address, Phone Number)
PersonalTypeDetail String // Specific details of the personal information
UserPersonal UserPersonal[] // Relation to UserPersonal
}

model UserPersonal {
UserPersonalID Int @id @default(autoincrement()) // Primary Key
User User @relation(fields: [UserID], references: [UserID])
UserID String
Personal Personal @relation(fields: [PersonalID], references: [PersonalID])
PersonalID Int
model PersonalType {
PersonalTypeID Int @id @default(autoincrement())
PersonalType String
PersonalTypeDetail String
Users User[]
}

0 comments on commit ce7d50c

Please sign in to comment.