migration to typescript

This commit is contained in:
JakkrapartXD 2026-01-09 06:28:15 +00:00
parent 924000b084
commit 9fde77468a
41 changed files with 11952 additions and 10164 deletions

View file

@ -49,6 +49,7 @@ Table user_profiles {
last_name varchar [not null]
phone varchar
avatar_url varchar
birth_date datetime
created_at datetime [not null, default: `now()`]
updated_at datetime
updated_by int [ref: > users.id]
@ -126,6 +127,29 @@ Table course_instructors {
}
}
Table course_approvals {
id int [pk, increment]
course_id int [not null, ref: > courses.id]
submitted_by int [not null, ref: > users.id, note: 'instructor who submitted']
reviewed_by int [ref: > users.id, note: 'admin who reviewed']
action varchar [not null, note: 'ENUM: SUBMITTED | APPROVED | REJECTED']
previous_status varchar [not null, note: 'status before this action']
new_status varchar [not null, note: 'status after this action']
comment text [note: 'admin comment or rejection reason']
created_at datetime [not null, default: `now()`]
Note: 'Tracks complete approval workflow history'
indexes {
course_id
submitted_by
reviewed_by
action
created_at
(course_id, created_at)
}
}
Table chapters {
id int [pk, increment]
course_id int [not null, ref: > courses.id]
@ -505,3 +529,6 @@ Table withdrawal_requests {
// - enrollments: CASCADE (delete with user/course)
// - announcements: CASCADE (delete with course)
// - quiz_attempts: CASCADE (delete with user)
Ref: "certificates"."issued_at" < "certificates"."enrollment_id"