Add created_lessons table for AI-generated lessons
This commit is contained in:
1 parent
667d5d83cc
commit
d2fe11ea6e
1 file changed
+5
-12
+5
-12
@@ -133,16 +133,9 @@ function migrate(db: Database.Database) {
|
||||
CREATE INDEX IF NOT EXISTS idx_drawings_user ON drawings(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_drawings_progress ON drawings(user_id, level, sublevel, status);
|
||||
CREATE INDEX IF NOT EXISTS idx_completions_user ON completions(user_id);
|
||||
`);
|
||||
|
||||
// Profile fields (added later — safe for existing databases)
|
||||
addColumn(db, "users", "display_name", "TEXT");
|
||||
addColumn(db, "users", "avatar", "TEXT");
|
||||
}
|
||||
|
||||
export function getDb(): Database.Database {
|
||||
if (!global.__drawitDb) {
|
||||
global.__drawitDb = createConnection();
|
||||
}
|
||||
return global.__drawitDb;
|
||||
}
|
||||
-- AI "Create" feature: a Creator types a subject; ComfyUI makes line art; we vectorize it into a lesson.
|
||||
CREATE TABLE IF NOT EXISTS created_lessons (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE, -- null once promoted to global
|
||||
level
|
||||
Reference in new issue
Block a user