fixed idx_sessions error
This commit is contained in:
@@ -22,6 +22,10 @@ function getDB() {
|
|||||||
db.exec(`ALTER TABLE sessions ADD COLUMN project_id INTEGER REFERENCES projects(id)`);
|
db.exec(`ALTER TABLE sessions ADD COLUMN project_id INTEGER REFERENCES projects(id)`);
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
|
try {
|
||||||
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_sessions_project ON sessions(project_id)`);
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
|
||||||
// Sync FTS index with any existing episodes data
|
// Sync FTS index with any existing episodes data
|
||||||
db.exec(`INSERT OR REPLACE INTO episodes_fts(rowid, user_message, ai_response)
|
db.exec(`INSERT OR REPLACE INTO episodes_fts(rowid, user_message, ai_response)
|
||||||
|
|||||||
@@ -87,9 +87,6 @@ const schema = `
|
|||||||
icon TEXT,
|
icon TEXT,
|
||||||
created_at INTEGER NOT NULL DEFAULT (unixepoch())
|
created_at INTEGER NOT NULL DEFAULT (unixepoch())
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_sessions_project
|
|
||||||
ON sessions(project_id);
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
module.exports = schema;
|
module.exports = schema;
|
||||||
Reference in New Issue
Block a user