- 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.
25 lines
943 B
SQL
25 lines
943 B
SQL
-- ============================================
|
|
-- 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".';
|