Skip to content

feat: sync pgpm modules from constructive-db (partman consumer trigger, jwt current_role_type, module table sync)#94

Open
pyramation wants to merge 6 commits into
mainfrom
feat/partman-consumer-trigger
Open

feat: sync pgpm modules from constructive-db (partman consumer trigger, jwt current_role_type, module table sync)#94
pyramation wants to merge 6 commits into
mainfrom
feat/partman-consumer-trigger

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Full sync of deploy/, revert/, verify/, and pgpm.plan trees from constructive-db/pgpm-modules (source of truth, as of constructive-io/constructive-db#1967 merged). Package versions in package.json / .control / Makefile are intentionally left unchanged; sql/ bundles regenerated at the existing versions.

Key changes:

  • partman: new partman.tg_after_insert_partition() + trigger partman_after_insert_partition on metaschema_public.partition. This is now the single parenting path via partman.create_parent_with_retention() on both platform and consumer databases — fixes no partition of relation "audit_log_auth" found for row on databases deployed from exported packages, where the INSERT ... ON CONFLICT DO NOTHING partition registration previously had no listener. Guarded by is_parented and partman.part_config so re-inserts are no-ops.
  • jwt-claims: add jwt_public.current_role_type() (referenced by exported policies but previously missing on consumer deploys).
  • jobs / database-jobs: complete_job now requires AND locked_by = worker_id.
  • metaschema-modules: add resource_module (unified K8s resource management); remove certificate_module, route_module, server_definition_module, server_deployment_module, config_secrets_org_module; sync module table definitions + missing revert/verify entries.
  • metaschema-schema: sync metaschema table definitions and node_type_registry seed.
  • services / object-tree: sync revert trees.

Link to Devin session: https://app.devin.ai/sessions/7d74797f980143949a673f4bfff58ebe
Requested by: @pyramation

- partman: add partman_after_insert_partition trigger — parents metaschema
  partition rows via pg_partman on consumer databases (fixes 'no partition
  of relation found for row' on redeployed/exported databases)
- jwt-claims: add jwt_public.current_role_type
- jobs/database-jobs: complete_job requires locked_by = worker_id
- metaschema-modules: add resource_module; remove certificate_module,
  route_module, server_definition_module, server_deployment_module,
  config_secrets_org_module; sync module table definitions
- metaschema-schema: sync table definitions + node_type_registry seed
- services: sync revert tree
- regenerate sql bundles (kept existing package versions)
@pyramation pyramation self-assigned this Jul 8, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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