Skip to content

Commit

Permalink
🥅 Catch all extant files in the FTS5 virtual table upon migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezzsim committed May 15, 2024
1 parent f46a5f1 commit 2d94d24
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def upgrade():
"""
CREATE VIRTUAL TABLE metadata_fts5 USING fts5(metadata, content='nodes', content_rowid='id');
""",
# Insert all existing node content into the fts5 table.
"""
INSERT INTO metadata_fts5(rowid, metadata)
SELECT id, metadata FROM nodes;
"""
# Triggers keep the index synchronized with the nodes table.
"""
CREATE TRIGGER nodes_metadata_fts5_sync_ai AFTER INSERT ON nodes BEGIN
Expand Down

0 comments on commit 2d94d24

Please sign in to comment.