-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'start-config' of https://github.com/Instituto-Maua-de-T…
…ecnologia/coil_mss into start-config
- Loading branch information
Showing
1 changed file
with
112 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 |
---|---|---|
@@ -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]) | ||
} | ||
|