build share count

This commit is contained in:
2026-03-28 22:02:37 -05:00
parent d1bfba89a8
commit d3fb42e8ed
6 changed files with 36 additions and 4 deletions

View File

@@ -66,6 +66,10 @@ if (!memesCols.find((c) => c.name === 'ocr_text')) {
db.exec('ALTER TABLE memes ADD COLUMN ocr_text TEXT');
}
if (!memesCols.find((c) => c.name === 'share_count')) {
db.exec('ALTER TABLE memes ADD COLUMN share_count INTEGER NOT NULL DEFAULT 0');
}
// Indexes that depend on migrated columns — created after columns are guaranteed to exist
db.exec(`
CREATE INDEX IF NOT EXISTS idx_memes_collection_id ON memes(collection_id);