feat(ocr): update this new migration to also add a ocr_last_processed column

This commit is contained in:
perf3ct
2025-07-16 20:10:07 +00:00
parent e040865905
commit 508cbeaa1b
2 changed files with 10 additions and 1 deletions

View File

@@ -107,6 +107,8 @@ CREATE TABLE IF NOT EXISTS "recent_notes"
CREATE TABLE IF NOT EXISTS "blobs" (
`blobId` TEXT NOT NULL,
`content` TEXT NULL DEFAULT NULL,
`ocr_text` TEXT DEFAULT NULL,
`ocr_last_processed` TEXT DEFAULT NULL,
`dateModified` TEXT NOT NULL,
`utcDateModified` TEXT NOT NULL,
PRIMARY KEY(`blobId`)

View File

@@ -6,16 +6,23 @@
// Migrations should be kept in descending order, so the latest migration is first.
const MIGRATIONS: (SqlMigration | JsMigration)[] = [
// Add OCR text column to blobs table for storing extracted text from images
// Add OCR text column and last processed timestamp to blobs table
{
version: 234,
sql: /*sql*/`\
-- Add OCR text column to blobs table
ALTER TABLE blobs ADD COLUMN ocr_text TEXT DEFAULT NULL;
-- Add OCR last processed timestamp to blobs table
ALTER TABLE blobs ADD COLUMN ocr_last_processed TEXT DEFAULT NULL;
-- Create index for OCR text searches
CREATE INDEX IF NOT EXISTS idx_blobs_ocr_text
ON blobs (ocr_text);
-- Create index for OCR last processed timestamp
CREATE INDEX IF NOT EXISTS idx_blobs_ocr_last_processed
ON blobs (ocr_last_processed);
`
},
// Migrate geo map to collection