Skip to content

bug: restore view triggers and dependent views when a view changes - #494

Merged
lukepolo merged 2 commits into
mainfrom
bug/view-trigger-reapply
Oct 2, 2026
Merged

lukepolo merged 2 commits into
mainfrom
bug/view-trigger-reapply

Conversation

@lukepolo

@lukepolo lukepolo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Re-applying a changed view dropped the INSTEAD OF triggers on v_pool_maps (and views removed by CASCADE), and boot skipped the unchanged files that would recreate them, so map-pool edits broke.

  • When any view file changes, boot re-applies every view and the trigger files that define INSTEAD OF triggers on views
  • Table trigger files keep their normal digest check, so unrelated tables aren't locked or backfilled
  • A boot that dies partway leaves the remaining files for the next boot to finish

From DEAFCS: DEAFCS/api-deafcs@9aec7932

Boot skips any file whose digest is unchanged. Recreating a view drops the
triggers on it (v_pool_maps lost its INSTEAD OF triggers, so every map-pool
insert failed) and, with CASCADE, the views built on it (player_perf_career
takes player_performance_v), while the files defining those still matched.
A change to any view file now re-applies every view and trigger file, in
the same order as a fresh install.
…sses

Forcing every view and trigger file wrote the view digests before the
trigger pass, so a boot that died in between never restored the
v_pool_maps triggers, and it re-ran all 68 trigger files (table locks,
the event_match_links backfill) on any view change. A view change now
deletes the digests of every view file and of the trigger files that
create INSTEAD OF triggers; each file writes its digest back only once
it applied, so an interrupted boot is finished by the next one and table
trigger files keep their normal digest check.
@lukepolo
lukepolo merged commit 35460da into main Oct 2, 2026
2 checks passed
@lukepolo
lukepolo deleted the bug/view-trigger-reapply branch October 2, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant