export declare const schema = "\nPRAGMA foreign_keys=ON;\n\nCREATE TABLE IF NOT EXISTS subjects (\n  id         INTEGER PRIMARY KEY AUTOINCREMENT,\n  name       TEXT    NOT NULL,\n  slug       TEXT    NOT NULL UNIQUE,\n  language   TEXT    NOT NULL DEFAULT '',\n  source     TEXT    NOT NULL DEFAULT 'manual'\n               CHECK (source IN ('manual','roadmap','pdf')),\n  created_at TEXT    NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE TABLE IF NOT EXISTS phases (\n  id          INTEGER PRIMARY KEY AUTOINCREMENT,\n  subject_id  INTEGER NOT NULL REFERENCES subjects(id) ON DELETE CASCADE,\n  name        TEXT    NOT NULL,\n  description TEXT    NOT NULL DEFAULT '',\n  sort_order  INTEGER NOT NULL DEFAULT 0\n);\n\nCREATE INDEX IF NOT EXISTS idx_phases_subject ON phases(subject_id);\n\nCREATE TABLE IF NOT EXISTS topics (\n  id          INTEGER PRIMARY KEY AUTOINCREMENT,\n  phase_id    INTEGER NOT NULL REFERENCES phases(id) ON DELETE CASCADE,\n  name        TEXT    NOT NULL,\n  description TEXT    NOT NULL DEFAULT '',\n  sort_order  INTEGER NOT NULL DEFAULT 0,\n  status      TEXT    NOT NULL DEFAULT 'todo'\n                CHECK (status IN ('todo','in_progress','done')),\n  updated_at  TEXT    NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_topics_phase  ON topics(phase_id);\nCREATE INDEX IF NOT EXISTS idx_topics_status ON topics(status);\n\nCREATE TABLE IF NOT EXISTS entries (\n  id          INTEGER PRIMARY KEY AUTOINCREMENT,\n  topic_id    INTEGER NOT NULL REFERENCES topics(id) ON DELETE CASCADE,\n  kind        TEXT    NOT NULL CHECK (kind IN ('question','answer','note')),\n  content     TEXT    NOT NULL DEFAULT '',\n  session_id  TEXT    NOT NULL DEFAULT '',\n  question_id INTEGER REFERENCES entries(id) ON DELETE SET NULL,\n  created_at  TEXT    NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_entries_topic   ON entries(topic_id);\nCREATE INDEX IF NOT EXISTS idx_entries_session ON entries(session_id);\n\nCREATE TABLE IF NOT EXISTS visualizations (\n  id         INTEGER PRIMARY KEY AUTOINCREMENT,\n  topic_id   INTEGER NOT NULL REFERENCES topics(id) ON DELETE CASCADE,\n  title      TEXT    NOT NULL DEFAULT '',\n  steps_json TEXT    NOT NULL DEFAULT '[]',\n  created_at TEXT    NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_viz_topic ON visualizations(topic_id);\n\nCREATE TABLE IF NOT EXISTS exercises (\n  id           INTEGER PRIMARY KEY AUTOINCREMENT,\n  topic_id     INTEGER NOT NULL REFERENCES topics(id) ON DELETE CASCADE,\n  title        TEXT    NOT NULL DEFAULT '',\n  type         TEXT    NOT NULL DEFAULT 'coding'\n                 CHECK (type IN ('coding','quiz','project','assignment')),\n  description  TEXT    NOT NULL DEFAULT '',\n  difficulty   TEXT    NOT NULL DEFAULT 'medium'\n                 CHECK (difficulty IN ('easy','medium','hard')),\n  est_minutes  INTEGER NOT NULL DEFAULT 0,\n  source       TEXT    NOT NULL DEFAULT 'ai'\n                 CHECK (source IN ('ai','pdf_import')),\n  starter_code TEXT    NOT NULL DEFAULT '',\n  test_content TEXT    NOT NULL DEFAULT '',\n  quiz_json    TEXT    NOT NULL DEFAULT '{}',\n  file_path    TEXT    NOT NULL DEFAULT '',\n  status       TEXT    NOT NULL DEFAULT 'pending'\n                 CHECK (status IN ('pending','in_progress','passed','failed')),\n  created_at   TEXT    NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_exercises_topic  ON exercises(topic_id);\nCREATE INDEX IF NOT EXISTS idx_exercises_status ON exercises(status);\n\nCREATE TABLE IF NOT EXISTS exercise_results (\n  id          INTEGER PRIMARY KEY AUTOINCREMENT,\n  exercise_id INTEGER NOT NULL REFERENCES exercises(id) ON DELETE CASCADE,\n  test_name   TEXT    NOT NULL DEFAULT '',\n  passed      INTEGER NOT NULL DEFAULT 0,\n  output      TEXT    NOT NULL DEFAULT '',\n  ran_at      TEXT    NOT NULL DEFAULT (datetime('now'))\n);\n\nCREATE INDEX IF NOT EXISTS idx_results_exercise ON exercise_results(exercise_id);\n\nCREATE TABLE IF NOT EXISTS settings (\n  key   TEXT PRIMARY KEY,\n  value TEXT NOT NULL DEFAULT ''\n);\n\n-- FTS5 virtual table for full-text search over entries\nCREATE VIRTUAL TABLE IF NOT EXISTS entries_fts\n  USING fts5(content, content='entries', content_rowid='id');\n\n-- Sync triggers: keep entries_fts up to date with entries\nCREATE TRIGGER IF NOT EXISTS entries_ai\n  AFTER INSERT ON entries BEGIN\n    INSERT INTO entries_fts(rowid, content) VALUES (new.id, new.content);\n  END;\n\nCREATE TRIGGER IF NOT EXISTS entries_ad\n  AFTER DELETE ON entries BEGIN\n    INSERT INTO entries_fts(entries_fts, rowid, content)\n      VALUES ('delete', old.id, old.content);\n  END;\n\nCREATE TRIGGER IF NOT EXISTS entries_au\n  AFTER UPDATE ON entries BEGIN\n    INSERT INTO entries_fts(entries_fts, rowid, content)\n      VALUES ('delete', old.id, old.content);\n    INSERT INTO entries_fts(rowid, content) VALUES (new.id, new.content);\n  END;\n";
/** Future migrations appended here in order (v1 is baseline — empty). */
export declare const migrations: string[];
