Skip to content

Add default schemas that are unique - #6047

Open
rbev wants to merge 2 commits into
masterfrom
default-schemas
Open

rbev wants to merge 2 commits into
masterfrom
default-schemas

Conversation

@rbev

@rbev rbev commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Separate primary and audit SQL schemas

  • Keep primary and audit tables in separate default schemas rather than supporting shared-schema installations.
  • To ensure that no data loss occurs if a misconfiguration points both audit and error at the same schema it is now checked before making changes.

Why

The schema default was to share the same schema, however there was no testing that ensures this is actually supported.

For SQL Server and PostgreSQL:

  • Default Database/Schema to psw_sc for primary instances and psw_audit for audit instances when the setting is absent or blank.
  • Fail setup before applying migrations if the target schema contains the other instance's migration history table. Primary instances reject __AuditMigrationsHistory; audit instances reject __EFMigrationsHistory.
  • Allow the other instance's migration history table in a different schema in the same database.

Custom schema names remain supported. Operators must create the schema and grant the configured user rights before running setup. Setup does not create schemas or move data.

Update persistence manifests, default-schema telemetry, and documentation to match.

@rbev rbev self-assigned this Oct 22, 2026
@rbev
rbev requested a review from johnsimons October 23, 2026 01:45
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