app/worker/migrations/0009_ladder_index_commit.sql
zzmq.dev@gmail.com/zz / app / worker / migrations / 0009_ladder_index_commit.sql
@ 3a45f02b
Download
Ladder Summary
- file This migration drops the existing `ladder_index` FTS5 virtual table and recreates it with an added `commit_sha` column (alongside `artifacts_name`, `path`, `kind`, and `summary`) so that ladder search hits can reference the specific commit they belong to. No functions or classes are exported from this file, as it is purely an SQL migration script.
-- Adds commit_sha so a Ladder search hit can link to both the file
-- AND the specific commit its current summary is anchored to (see
-- webApp.ts's new per-commit view). FTS5 virtual tables don't support
-- ALTER TABLE ADD COLUMN the way a normal table does, so this
-- recreates it -- safe: ladder_index is a regenerable index (every
-- repo's next ladder_write_rung repopulates its own rows), never a
-- source of truth, so losing existing rows here is cosmetic, not data
-- loss.
DROP TABLE IF EXISTS ladder_index;
CREATE VIRTUAL TABLE ladder_index USING fts5(
artifacts_name UNINDEXED,
path UNINDEXED,
kind UNINDEXED,
commit_sha UNINDEXED,
summary
);