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:
24
backend/sql/add-native-language-to-courses.sql
Normal file
24
backend/sql/add-native-language-to-courses.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- ============================================
|
||||
-- Füge native_language_id zu vocab_course hinzu
|
||||
-- ============================================
|
||||
-- Dieses Feld speichert die Muttersprache des Lerners
|
||||
-- z.B. "Bisaya für Deutschsprachige" -> language_id = Bisaya, native_language_id = Deutsch
|
||||
|
||||
-- Spalte hinzufügen
|
||||
ALTER TABLE community.vocab_course
|
||||
ADD COLUMN IF NOT EXISTS native_language_id INTEGER;
|
||||
|
||||
-- Foreign Key Constraint hinzufügen
|
||||
ALTER TABLE community.vocab_course
|
||||
ADD CONSTRAINT vocab_course_native_language_fk
|
||||
FOREIGN KEY (native_language_id)
|
||||
REFERENCES community.vocab_language(id)
|
||||
ON DELETE SET NULL;
|
||||
|
||||
-- Index für bessere Performance
|
||||
CREATE INDEX IF NOT EXISTS vocab_course_native_language_idx
|
||||
ON community.vocab_course(native_language_id);
|
||||
|
||||
-- Kommentar hinzufügen
|
||||
COMMENT ON COLUMN community.vocab_course.native_language_id IS
|
||||
'Muttersprache des Lerners (z.B. Deutsch, Englisch). NULL bedeutet "für alle Sprachen".';
|
||||
Reference in New Issue
Block a user