Stop installing uuid-ossp in migration 1 - #580
Merged
Merged
Conversation
Migration 1 ran CREATE EXTENSION IF NOT EXISTS "uuid-ossp". Nothing in the schema uses it: every generated UUID comes from the built-in gen_random_uuid(). CREATE EXTENSION needs CREATE on the database, even for a trusted extension, so a role granted only USAGE and CREATE on a pre-created DBOS schema could not migrate a new system database: permission denied to create extension "uuid-ossp" Python dropped the statement in 3.0.0 (py#853) and TypeScript in 5.0 (ts#1362); Go never had it. Databases that already ran migration 1 keep the extension; nothing drops it. MigrationManagerTest gains a test that migrates a new system database as such a role, which fails with the error above when the statement is present. The historical migration 1 copy in that test keeps the statement, since it stands for a database an older release created. Closes #576
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Removes the unused uuid-ossp installation from migration 1 and adds regression coverage for schema-scoped migration roles.
Changes:
- Removes the unnecessary extension creation.
- Adds a least-privilege PostgreSQL migration test.
- Preserves the historical migration fixture.
| File | Description |
|---|---|
transact/src/test/java/dev/dbos/transact/migrations/MigrationManagerTest.java |
Adds schema-scoped role migration coverage. |
transact/src/main/java/dev/dbos/transact/migrations/MigrationManager.java |
Removes uuid-ossp installation from migration 1. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kraftp
approved these changes
Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration 1 ran
CREATE EXTENSION IF NOT EXISTS "uuid-ossp", which nothing in the schema uses: every generated UUID comes from the built-ingen_random_uuid().CREATE EXTENSIONneedsCREATEon the database, even for a trusted extension, so a role granted onlyUSAGE, CREATEon a pre-created DBOS schema could not migrate a new system database:Change
MigrationManager.MigrationManagerTest.getOriginalMigration1()keeps its copy of the statement, since it stands for a database an older release created.Test.
MigrationManagerTest.aSchemaScopedRoleCanMigrateANewSystemDatabase: an administrator creates the database, a login role and the DBOS schema, and grants the role onlyUSAGE, CREATEon that schema. The role then migrates the new system database, and every expected table exists. With the statement restored, the test fails with the error above. It is skipped on CockroachDB, whose privilege model differs.MigrationManagerTestpasses on Postgres (24/24). Not run locally: CockroachDB.Parity. Python dropped the statement in 3.0.0 (py#853, closing py#852), and TypeScript in 5.0 (ts#1362). Go never had it.
Closes #576
🤖 Generated with Claude Code