mirror of
https://github.com/block/buzz.git
synced 2026-11-12 12:22:06 +00:00
The brownfield migration path — where 0012 DROP + re-ADDs search_tsv on populated production databases still on the pre-#1771 negative blocklist — was exercised by zero tests. The fresh-install (allowlist) path always no-oped via setup(), and migration.rs only string-matched the SQL text. Add two integration tests: - migration_0012_rewrites_legacy_blocklist_to_exclude_drafts: constructs the legacy state (0001–0007 → seed row → 0008 skips → 0009–0011), seeds kind:9 control + kind:31234 draft, applies 0012, and asserts the rewrite took effect: expression contains 31234, GIN index rebuilt, control row searchable, draft row's search_tsv NULL, discriminator correctly classifies the post-rewrite expression as blocklist-shaped. - migration_0012_noops_on_fresh_install_allowlist: verifies the fresh-install expression has the ELSE NULL shape that 0012's discriminator detects. Also applies migrations 0009–0011 in setup() so the test chain matches production exactly (previously omitted).