fix(ddl): replace worm_audit_purge when the owner revoked its own EXECUTE #16

Merged
KofTwentyTwo merged 1 commits from feature/purge-replace-as-owner into develop 2026-10-15 14:16:36 +00:00
KofTwentyTwo commented 2026-10-15 14:14:09 +00:00 (Migrated from github.com)

PostgreSQL refuses CREATE OR REPLACE FUNCTION worm_audit_purge when its owner has revoked its own EXECUTE, which is the CNPG shape: the runtime role owns the schema and worm-audit:6 revokes its EXECUTE. Website-Backend#260 hit this in ChangelogDefaultRolePostgresIntegrationTest.

worm-audit:13 now grants EXECUTE back to the migrating role only when it is missing, replaces the function, and revokes it again in the same transaction. No change for owners that keep EXECUTE. Verified by WB's CNPG-shaped changelog test, and ./mvnw verify passes here.

🤖 Generated with Claude Code

PostgreSQL refuses `CREATE OR REPLACE FUNCTION worm_audit_purge` when its owner has revoked its own EXECUTE, which is the CNPG shape: the runtime role owns the schema and `worm-audit:6` revokes its EXECUTE. Website-Backend#260 hit this in `ChangelogDefaultRolePostgresIntegrationTest`. `worm-audit:13` now grants EXECUTE back to the migrating role only when it is missing, replaces the function, and revokes it again in the same transaction. No change for owners that keep EXECUTE. Verified by WB's CNPG-shaped changelog test, and `./mvnw verify` passes here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.