Skip to content

Docs: the resource setup hosted service migrates message storage regardless of AutoCreate - #5445

Merged
jeremydmiller merged 1 commit into
mainfrom
docs-resource-setup-ignores-autocreate
Nov 9, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
docs-resource-setup-ignores-autocreate

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

What changed

docs/guide/durability/managing.md said that UseResourceSetupOnStartup() runs "respecting the AutoCreate policy, so it can stay registered in every environment". That's not true for Wolverine's message storage. The hosted service calls MessageStoreResource.Setup(), which always migrates with CreateOrUpdate (src/Wolverine/Persistence/Durability/MessageStoreResource.cs), the same as resources setup.

  • Removed the claim and added a ::: warning explaining what happens under a database role that can't run DDL, and what to do instead (build the schema in a deployment step with an elevated role, gate with db-assert)
  • Added the UseResourceSetupOnStartup() / AddResourceSetupOnStartup() hosted service to the list of explicit setup operations in the "Disable Automatic Storage Migration" tip

Why

A client runs EF Core migration bundles plus resources setup under a migrator role, then deploys services with DML-only PostgreSQL roles. Following the old wording would leave the setup service registered in those services.

Verified

Against PostgreSQL (port 5433), Wolverine 6.63.0, AutoBuildMessageStorageOnStartup = AutoCreate.None, a role with only USAGE on the schema, SELECT/INSERT/UPDATE/DELETE on the tables, and USAGE, SELECT on the sequences:

  • Schema in sync + AddResourceSetupOnStartup(): starts normally
  • wolverine_recurring_messages dropped (drift) + AddResourceSetupOnStartup(): startup fails with Weasel.Core.InsufficientDatabasePrivilegeException (42501: permission denied for schema ...)
  • Same drift, no setup service: starts

Docs only; the docs site was not rebuilt locally.

🤖 Generated with Claude Code

…rdless of AutoCreate

managing.md said UseResourceSetupOnStartup() respects the AutoCreate policy and can stay
registered in every environment. For Wolverine's message store it does not: the hosted
service calls MessageStoreResource.Setup(), which always migrates with CreateOrUpdate.
Under a DML-only database role that means a drifted schema fails startup with Weasel's
InsufficientDatabasePrivilegeException.

Replaces the claim with a warning describing that behavior and the alternative (build
the schema in a deployment step, gate with db-assert), and adds the hosted service to
the list of explicit setup operations in the AutoCreate tip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 2bd4aa0 into main Nov 9, 2026
5 checks passed
This was referenced Nov 9, 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