Skip to content

feat(db): webhook tables migration (DEV-44)#11

Merged
RndmCodeGuy20 merged 1 commit into
stagingfrom
feat/dev-44-webhook-migration
Jun 16, 2026
Merged

feat(db): webhook tables migration (DEV-44)#11
RndmCodeGuy20 merged 1 commit into
stagingfrom
feat/dev-44-webhook-migration

Conversation

@RndmCodeGuy20

Copy link
Copy Markdown
Owner

Closes DEV-44. First ticket of the webhook epic (DEV-40); unblocks DEV-45/46/47.

Adds migration 000002_webhooks with two tables:

  • webhook_registrations — url + encrypted secret per caller
  • webhook_deliveries — outbox (event, asset_id, job_id, payload, status, attempts, next_attempt_at, delivered_at), partial index on next_attempt_at WHERE status='pending' for the delivery poll

Notes

  • Uses uuid_generate_v4() + IF NOT EXISTS to match the existing schema and the dual Go/Python migration runners.
  • ON DELETE CASCADE from deliveries → registration; asset_id/job_id kept as plain columns (outbox is an independent ledger).
  • Verified up + down against a throwaway Postgres 16: tables/FK/index correct, down round-trips to zero webhook tables.

🤖 Generated with Claude Code

- New migration 000002 for the webhook system (DEV-44)
- webhook_deliveries is the outbox: status, attempts, next_attempt_at
- Partial index on next_attempt_at WHERE status='pending' for the poll loop
- ON DELETE CASCADE from deliveries to their registration
- uuid_generate_v4 + IF NOT EXISTS to match existing schema conventions
@RndmCodeGuy20 RndmCodeGuy20 merged commit ed0b38f into staging Jun 16, 2026
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