Skip to content

feat: upstream COMMENT ON statements, inflection improvements, and other changes from constructive-db#43

Open
pyramation wants to merge 3 commits intomainfrom
devin/1772104272-upstream-comments-and-changes
Open

feat: upstream COMMENT ON statements, inflection improvements, and other changes from constructive-db#43
pyramation wants to merge 3 commits intomainfrom
devin/1772104272-upstream-comments-and-changes

Conversation

@pyramation
Copy link
Contributor

Summary

Bulk upstream of changes that accumulated in constructive-io/constructive-db/pgpm-modules/ but were never synced back to this repo. The changes fall into three categories:

  1. COMMENT ON statements (~294 additions): Adds PostgreSQL COMMENT ON documentation to tables, columns, domains, constraints, and procedures across 11 modules: achievements, database-jobs, encrypted-secrets-table, jobs, measurements, uuid, types, geotypes, metaschema-schema, metaschema-modules, and services.

  2. Inflection module improvements: Fixes octopioctopuses, adds uncountable word handling (sheep, equipment, information, etc.), adds Latin suffix overrides (schemataschema, phenomenaphenomenon, etc.), and introduces a new should_skip_uncountable procedure. Tests expanded accordingly.

  3. Schema/structural changes:

    • jwt-claims: New current_session_id procedure, version bumped to 0.15.5
    • metaschema-modules: New relation_provision table (deploy/revert/verify), @omit/@fieldName constraint annotations
    • metaschema-schema: object_category type changes, pgpm.plan updates, test snapshots added
    • types: New pgpm-types--0.15.5.sql, version control file changed, test rewrites

Review & Testing Checklist for Human

  • types version downgrade: pgpm-types.control changes default_version from 0.16.00.15.5. The repo already has a pgpm-types--0.16.0.sql file. Verify this is intentional and won't break consumers expecting 0.16.0.
  • types test coverage reduction: domains.test.ts and domains.pgutils.test.ts were substantially rewritten to simpler versions. The origin column was removed from the test table, and origin-specific tests were dropped. Verify the reduced test surface is acceptable.
  • Inflection behavioral changes: Plural/singular rules changed (octopioctopuses, new uncountable words, Latin suffixes). Verify downstream consumers are compatible with these linguistic corrections.
  • metaschema-modules structural changes: New relation_provision table added; field_module revert/verify files modified; large diff in compiled metaschema-modules--0.15.5.sql. Verify these schema changes are safe for existing deployments.
  • Spot-check COMMENT ON accuracy: Pick a few modules and verify the comments accurately describe the columns/tables (e.g., check jobs.jobs table comments against actual schema).

Test Plan

  1. Deploy to a test database and verify migrations apply cleanly
  2. Run test suites for modified packages (especially inflection, types, metaschema-modules)
  3. Verify no breaking changes for downstream consumers (e.g., check if any apps depend on pgpm-types@0.16.0)

Notes

  • Changes were bulk-copied from constructive-db/pgpm-modules/ to pgpm-modules/packages/ after verifying no remaining diffs (excluding node_modules, package.json, and files only in upstream)
  • Some files only in upstream (secure_table_provision, rls_function, services/__tests__, pgpm-types--0.16.0.sql) were intentionally left untouched
  • Link to Devin run: https://app.devin.ai/sessions/462ca0fe097045f58a173180575d4a27
  • Requested by: @pyramation

…her changes from constructive-db

- Add 294 COMMENT ON statements across 29 files documenting tables, columns,
  domains, constraints, and procedures
- Upstream inflection module improvements: uncountable words handling,
  Latin suffix overrides (schemata->schema, phenomena->phenomenon, etc.),
  octopi->octopuses fix, new test cases, should_skip_uncountable procedure
- Add jwt-claims current_session_id procedure and 0.15.5 version
- Add metaschema-modules relation_provision table (deploy/revert/verify)
- Add metaschema-schema test snapshots
- Add types 0.15.5 version
- Sync metaschema-schema object_category type changes
- Sync metaschema-modules field_module, table_module, rls_module changes
- Various module version bumps and README updates
@devin-ai-integration
Copy link

🤖 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 and CI monitoring

…, delete stale snapshots

- Revert types test rewrites (domain validation tests written for stricter constraints)
- Revert types Makefile/control version downgrade (keep 0.16.0)
- Revert metaschema-schema test rewrite (depends on services module not available in isolated CI)
- Update table_module test: private_schema_id -> schema_id, add table_name and use_rls assertions
- Delete stale snapshot files for metaschema-modules, metaschema-schema, and services (will regenerate)
…ginal tests and snapshots

- Revert table_module structural changes (private_schema_id->schema_id rename, new columns)
- Revert rls_module structural changes (tokens_table_id->session_credentials_table_id rename)
- Revert profiles_module structural change (removed bitlen column)
- Remove relation_provision new table (not yet supported by existing tests)
- Restore original metaschema-modules test file, snapshots, pgpm.plan, and SQL version
- Restore original services snapshot file
- Keep all COMMENT ON additions and non-breaking changes (field_module comments, table_template_module comments)
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