Files
yourpart3/check-vocab-schema.sql

39 lines
1.1 KiB
SQL
Executable File

-- ============================================
-- Prüfe ob alle notwendigen Spalten vorhanden sind
-- ============================================
-- Führe diese Queries auf dem Server aus, um zu prüfen, ob alles vorhanden ist
-- Prüfe native_language_id in vocab_course
SELECT
column_name,
data_type,
is_nullable
FROM information_schema.columns
WHERE table_schema = 'community'
AND table_name = 'vocab_course'
AND column_name = 'native_language_id';
-- Prüfe cultural_notes in vocab_course_lesson
SELECT
column_name,
data_type,
is_nullable
FROM information_schema.columns
WHERE table_schema = 'community'
AND table_name = 'vocab_course_lesson'
AND column_name = 'cultural_notes';
-- Prüfe ob vocab_grammar_exercise Tabelle existiert
SELECT EXISTS (
SELECT FROM information_schema.tables
WHERE table_schema = 'community'
AND table_name = 'vocab_grammar_exercise'
);
-- Prüfe ob vocab_grammar_exercise_type Tabelle existiert
SELECT EXISTS (
SELECT FROM information_schema.tables
WHERE table_schema = 'community'
AND table_name = 'vocab_grammar_exercise_type'
);