Skip to content

Commit 7533086

Browse files
committed
feat: update Present model and schema to include createdAt and updatedAt fields
1 parent 7db4046 commit 7533086

2 files changed

Lines changed: 10 additions & 26 deletions

File tree

backend/prisma/schema.prisma

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ model Candidate {
5151
model Team {
5252
id String @id @default(uuid()) @db.VarChar(36)
5353
group Int @unique @db.Int
54-
name String? @unique @db.VarChar(255)
54+
name String? @unique @db.VarChar(255)
5555
mentorshipId String @map("mentorship_id") @db.VarChar(36)
5656
leaderId String? @unique @map("leader_id") @db.VarChar(36)
5757
topicId String @map("topic_id") @db.VarChar(36)
@@ -63,6 +63,7 @@ model Team {
6363
candidates Candidate[] @relation("CandidateToTeam")
6464
submissions Submission[]
6565
reports Report[]
66+
presents Present[]
6667
6768
@@map("teams")
6869
}
@@ -172,23 +173,17 @@ model BaremScore {
172173
@@map("scores")
173174
}
174175

175-
// tạo 1 bảng lưu lại thông tin đăng ký thời gian present của ứng viên bao gồm
176-
// id
177-
// team_id - quan hệ với team
178-
// thời gian present thử - json
179-
// thời gian present thật - json
176+
model Present {
177+
id String @id @default(uuid()) @db.VarChar(36)
178+
teamId String @map("team_id") @db.VarChar(36)
180179
181-
// created_at
182-
// updated_at
180+
tentativeSchedule Json @map("tentative_schedule") @db.Json
181+
finalSchedule Json @map("final_schedule") @db.Json
183182
184-
model Present {
185-
id String @id @default(uuid()) @db.VarChar(36)
186-
teamId String @map("team_id") @db.VarChar(36)
187-
tentativeSchedule String @map("tentative_schedule") @db.Json
188-
finalSchedule String @map("final_schedule") @db.Json
189-
createdAt DateTime @default(now()) @map("created_at")
190-
updatedAt DateTime @updatedAt @map("updated_at")
183+
createdAt DateTime @default(now()) @map("created_at")
184+
updatedAt DateTime @updatedAt @map("updated_at")
191185
186+
// Quan hệ với model Team
192187
team Team @relation(fields: [teamId], references: [id])
193188
194189
@@map("presents")

backend/src/schemas/present.schema.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import { v4 as uuidv4 } from "uuid";
2-
// model Present {
3-
// id String @id @default(uuid()) @db.VarChar(36)
4-
// teamId String @map("team_id") @db.VarChar(36)
5-
// tentativeSchedule String @map("tentative_schedule") @db.Json
6-
// finalSchedule String @map("final_schedule") @db.Json
7-
// createdAt DateTime @default(now()) @map("created_at")
8-
// updatedAt DateTime @updatedAt @map("updated_at")
92

10-
// team Team @relation(fields: [teamId], references: [id])
11-
12-
// @@map("presents")
13-
// }
143
interface PresentType {
154
id?: string;
165
teamId: string;

0 commit comments

Comments
 (0)