Skip to content

Commit

Permalink
Merge branch 'start-config' of https://github.com/Instituto-Maua-de-T…
Browse files Browse the repository at this point in the history
…ecnologia/coil_mss into start-config
  • Loading branch information
FelipeCarillo committed Mar 18, 2024
2 parents 411e4c8 + 73c11cb commit a55b010
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
id String @id
name String?
email String @unique
password String
userTypeId Int
courseId Int?
semesterCourse Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
course Course? @relation(fields: [courseId], references: [id])
userType UserType @relation(fields: [userTypeId], references: [id])
projects ProjectUser[]
ProjectCourse ProjectCourse[]
userCourses UserCourse[]
}

model UserType {
id Int @id @default(autoincrement())
name String
users User[]
}

model Course {
id Int @id @default(autoincrement())
name String
users User[]
userCourses UserCourse[]
}

model UserCourse {
userId String
courseId Int
user User @relation(fields: [userId], references: [id])
course Course @relation(fields: [courseId], references: [id])
@@id([userId, courseId])
}

model Project {
id Int @id @default(autoincrement())
startDate DateTime
endDate DateTime
description String
language String
published Boolean
users ProjectUser[]
projectCourses ProjectCourse[]
projectPartners ProjectPartner[]
projectCriterias ProjectCriteria[]
}

model ProjectUser {
id Int @id @default(autoincrement())
projectId Int
userId String
userAceppted Boolean
project Project @relation(fields: [projectId], references: [id])
user User @relation(fields: [userId], references: [id])
}

model ProjectCourse {
projectId Int
userId String
project Project @relation(fields: [projectId], references: [id])
user User @relation(fields: [userId], references: [id])
@@id([projectId, userId])
}

model PartnerInstitution {
id Int @id @default(autoincrement())
partnerName String
partnerEmail String
partnerCountry String
patnerWebsite String?
projectPartners ProjectPartner[]
}

model ProjectPartner {
projectId Int
partnerInstitutionId Int
project Project @relation(fields: [projectId], references: [id])
partnerInstitution PartnerInstitution @relation(fields: [partnerInstitutionId], references: [id])
@@id([projectId, partnerInstitutionId])
}

model Criteria {
id Int @id @default(autoincrement())
criteriaName String
projectCriterias ProjectCriteria[]
}

model ProjectCriteria {
projectId Int
criteriaId Int
project Project @relation(fields: [projectId], references: [id])
criteria Criteria @relation(fields: [criteriaId], references: [id])
@@id([projectId, criteriaId])
}

0 comments on commit a55b010

Please sign in to comment.