feat: add is_recommended to Course and allow_multiple_attempts to Quiz
- Add is_recommended field to Course model (default: false) - Add allow_multiple_attempts field to Quiz model (default: true) - Create migration: add_recommended_and_quiz_attempts
This commit is contained in:
parent
0afbd3f08b
commit
623f797763
1 changed files with 5 additions and 3 deletions
|
|
@ -137,6 +137,7 @@ model Course {
|
||||||
price Decimal @default(0) @db.Decimal(10, 2)
|
price Decimal @default(0) @db.Decimal(10, 2)
|
||||||
is_free Boolean @default(false)
|
is_free Boolean @default(false)
|
||||||
have_certificate Boolean @default(false)
|
have_certificate Boolean @default(false)
|
||||||
|
is_recommended Boolean @default(false)
|
||||||
status CourseStatus @default(DRAFT)
|
status CourseStatus @default(DRAFT)
|
||||||
approved_by Int?
|
approved_by Int?
|
||||||
approved_at DateTime?
|
approved_at DateTime?
|
||||||
|
|
@ -304,6 +305,7 @@ model Quiz {
|
||||||
shuffle_choices Boolean @default(false)
|
shuffle_choices Boolean @default(false)
|
||||||
show_answers_after_completion Boolean @default(true)
|
show_answers_after_completion Boolean @default(true)
|
||||||
is_skippable Boolean @default(true)
|
is_skippable Boolean @default(true)
|
||||||
|
allow_multiple_attempts Boolean @default(true)
|
||||||
created_at DateTime @default(now())
|
created_at DateTime @default(now())
|
||||||
created_by Int
|
created_by Int
|
||||||
updated_at DateTime? @updatedAt
|
updated_at DateTime? @updatedAt
|
||||||
|
|
@ -640,11 +642,11 @@ model AuditLog {
|
||||||
action AuditAction
|
action AuditAction
|
||||||
entity_type String @db.VarChar(100) // Course, User, Lesson, Quiz, etc.
|
entity_type String @db.VarChar(100) // Course, User, Lesson, Quiz, etc.
|
||||||
entity_id Int?
|
entity_id Int?
|
||||||
old_value Json? // ค่าเดิม (สำหรับ UPDATE/DELETE)
|
old_value Json? // ค่าเดิม (สำหรับ UPDATE/DELETE)
|
||||||
new_value Json? // ค่าใหม่ (สำหรับ CREATE/UPDATE)
|
new_value Json? // ค่าใหม่ (สำหรับ CREATE/UPDATE)
|
||||||
ip_address String? @db.VarChar(45) // รองรับ IPv6
|
ip_address String? @db.VarChar(45) // รองรับ IPv6
|
||||||
user_agent String? @db.Text
|
user_agent String? @db.Text
|
||||||
metadata Json? // ข้อมูลเพิ่มเติม เช่น request_id, session_id
|
metadata Json? // ข้อมูลเพิ่มเติม เช่น request_id, session_id
|
||||||
created_at DateTime @default(now())
|
created_at DateTime @default(now())
|
||||||
|
|
||||||
user User? @relation(fields: [user_id], references: [id], onDelete: SetNull)
|
user User? @relation(fields: [user_id], references: [id], onDelete: SetNull)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue