Add native language support in vocab course management
- Introduced a new field for native language in the VocabCourse model to allow learners to specify their native language. - Updated the VocabService to handle native language during course creation and retrieval, including filtering options. - Enhanced the database schema to include foreign key constraints for native language. - Updated frontend components to support native language selection and display in course listings. - Added internationalization strings for native language features in both German and English.
This commit is contained in:
@@ -152,6 +152,7 @@ const syncDatabase = async () => {
|
||||
title TEXT NOT NULL,
|
||||
description TEXT,
|
||||
language_id INTEGER NOT NULL,
|
||||
native_language_id INTEGER,
|
||||
difficulty_level INTEGER DEFAULT 1,
|
||||
is_public BOOLEAN DEFAULT false,
|
||||
share_code TEXT,
|
||||
@@ -165,6 +166,10 @@ const syncDatabase = async () => {
|
||||
FOREIGN KEY (language_id)
|
||||
REFERENCES community.vocab_language(id)
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT vocab_course_native_language_fk
|
||||
FOREIGN KEY (native_language_id)
|
||||
REFERENCES community.vocab_language(id)
|
||||
ON DELETE SET NULL,
|
||||
CONSTRAINT vocab_course_share_code_uniq UNIQUE (share_code)
|
||||
);
|
||||
|
||||
@@ -239,6 +244,8 @@ const syncDatabase = async () => {
|
||||
ON community.vocab_course(owner_user_id);
|
||||
CREATE INDEX IF NOT EXISTS vocab_course_language_idx
|
||||
ON community.vocab_course(language_id);
|
||||
CREATE INDEX IF NOT EXISTS vocab_course_native_language_idx
|
||||
ON community.vocab_course(native_language_id);
|
||||
CREATE INDEX IF NOT EXISTS vocab_course_public_idx
|
||||
ON community.vocab_course(is_public);
|
||||
CREATE INDEX IF NOT EXISTS vocab_course_lesson_course_idx
|
||||
|
||||
Reference in New Issue
Block a user