feat(db): update index and fix suggestion from gemini

This commit is contained in:
perfectra1n
2026-03-22 09:22:55 -07:00
parent 124d456c60
commit 81f02209ea
2 changed files with 4 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes"
`entityId`
);
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
CREATE INDEX IDX_branches_parentNoteId_isDeleted_notePosition ON branches (parentNoteId, isDeleted, notePosition);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);

View File

@@ -22,8 +22,9 @@ const MIGRATIONS: (SqlMigration | JsMigration)[] = [
ON attributes (isDeleted, utcDateModified);
CREATE INDEX IF NOT EXISTS IDX_attachments_isDeleted_utcDateModified
ON attachments (isDeleted, utcDateModified);
CREATE INDEX IF NOT EXISTS IDX_attachments_utcDateScheduledForErasureSince
ON attachments (utcDateScheduledForErasureSince);
DROP INDEX IF EXISTS IDX_branches_parentNoteId;
CREATE INDEX IF NOT EXISTS IDX_branches_parentNoteId_isDeleted_notePosition
ON branches (parentNoteId, isDeleted, notePosition);
`
},
// Migrate aiChat notes to code notes since LLM integration has been removed