diff --git a/001_documentation/Requirements/REQ0006/schema.dbml b/001_documentation/Requirements/REQ0006/schema.dbml index 1d0dff1..7d0409e 100644 --- a/001_documentation/Requirements/REQ0006/schema.dbml +++ b/001_documentation/Requirements/REQ0006/schema.dbml @@ -1,4 +1,5 @@ // LessonTypes stores different types of lessons +// lesson_types, lesson_type Table LessonTypes { // system field id int [pk, increment] // unique identifier for the lesson type @@ -10,6 +11,7 @@ Table LessonTypes { } // LessonCategories stores categories of lessons +// lesson_categories, lesson_category Table LessonCategories { // system field id int [pk, increment] // unique identifier for the lesson category @@ -133,5 +135,81 @@ Table Vocabularies { sample_c varchar // Sample sentence in Chinese using the word cat_id integer [ref: > LessonCategories.id] // foreign key referring to LessonCategories.id category varchar // The category to which the lesson belongs + lesson_type_id integer [ref: > LessonTypes.id] // foreign key referring to LessonTypes.id } +// Listening Practice Quiz Categories +// store listening practice category, (LpCategories, LpCategory) +Table QuizLPCategories { + // system fields + id text [pk] // changed from int to text to match PocketBase + created datetime [default: `now()`] + updated datetime + + // value fields + cat_name varchar [presentable: true] // added presentable flag + cat_image file // changed from blob to file type + pos number // changed from integer to number + init_answer json +} + +// Listening Practice Quiz Questions +Table QuizLPQuestions { + id int [pk, increment] + created datetime [default: `now()`] + updated datetime + word varchar + sound blob + cat_id integer [ref: > QuizLPCategories.id] +} + +// Matching Frenzy Quiz Categories +Table QuizMFCategories { + id int [pk, increment] + created datetime [default: `now()`] + updated datetime + cat_name varchar + cat_image blob + pos integer + init_answer json +} + +// Matching Frenzy Quiz Questions +Table QuizMFQuestions { + id int [pk, increment] + created datetime [default: `now()`] + updated datetime + word varchar + word_c varchar + cat_id integer [ref: > QuizMFCategories.id] +} + +// Connectives Revision Quiz Categories +Table QuizCRCategories { + id int [pk, increment] + created datetime [default: `now()`] + updated datetime + cat_name varchar + cat_image blob + pos integer + init_answer json +} + +// Connectives Revision Quiz Questions +Table QuizCRQuestions { + id int [pk, increment] + created datetime [default: `now()`] + updated datetime + question_fh varchar + question_sh varchar + modal_ans varchar + cat_id integer [ref: > QuizCRCategories.id] +} + +// Test table +Table t1 { + id int [pk, increment] + created datetime [default: `now()`] + updated datetime + name varchar +}