Foreign keys between the webhooks tables, with an orphan-safe upgrade #17

Merged
KofTwentyTwo merged 3 commits from feature/foreign-keys into develop 2026-10-14 23:00:29 +00:00
3 Commits
Author SHA1 Message Date
james.maesandClaude Opus 5.5 1259fa25fe Merge origin/develop into feature/foreign-keys
Keeps both changelog entries. H2 tests and the demo server load
src/test/resources/webhooks-h2.sql (FKs in H2 syntax), never the Postgres DDL
or the pg_temp upgrade script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:52:26 -05:00
james.maesandClaude Opus 5.5 3636aacc26 style(test): import order in the foreign key guardrail test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:25:18 -05:00
james.maesandClaude Opus 5.5 a160ef216d feat(ddl): foreign keys between the webhooks tables, with an orphan-safe upgrade
Declare a named foreign key for every join and table possible-value field
between the five webhooks tables. Endpoint secrets and subscriptions are
deleted with their endpoint; deliveries and attempts keep it (RESTRICT);
a delivery outlives its subscription (SET NULL); attempts go with their
delivery. The upgrade script quarantines orphans before adding the keys and
replaces the NO ACTION endpoint keys. A Testcontainers guardrail test fails
when a new relation has no key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:15:19 -05:00