mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 21:46:49 +00:00
a198dde5d2
The foreign key index check took every index from PRAGMA index_list as a usable prefix, partial ones included. An index like CREATE INDEX ix ON c(p_id) WHERE state = 'open' would satisfy FKIDX-001, yet the cascade lookup WHERE p_id = ? still scans the table, which is the regression the check exists to catch. A partial index now counts only when its predicate is IS NOT NULL on the key's own columns, the one form SQLite can prove from p_id = ?. Nothing in today's schema depends on a partial index alone, so the result on the migrated snapshot is unchanged.