Move all database objects into a configurable dedicated schema #13
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dedicated-schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Moves every Viegard database object out of the PostgreSQL default
publicschema and into a dedicated schema, configurable per deployment viaViegard__Database__Schemain docker-compose.yml (default:viegard).Design: the schema is applied through the connection
search_pathrather thanHasDefaultSchema, so the EF model, the generated migration, and the raw queue SQL all stay schema-agnostic (the regenerated migration is byte-identical to the previous one). The EF migrations-history table is explicitly pinned to the configured schema via a new sharedViegardDbContextConfigurationhelper used by the runtime hosts, the design-time factory, and the integration tests. The pipeline creates the schema on startup if missing.Because the schema name participates in
CREATE SCHEMADDL, it is validated fail-closed:^[a-z][a-z0-9_]*$, max 63 characters.Docs: compose example documents the new setting for both services;
docs/deployment.mdgains a Database schema section including the reset path for deployments that already migrated intopublic(with an optional row-export step first). D-0024 amendment recorded; AGENT-README current state refreshed.How was this tested?
dotnet build- 0 errors, 0 warningsdotnet test- 263 passed, 7 skipped (live-PostgreSQL integration tests; local WSL Docker unavailable)Note: live verification against PostgreSQL will happen on the deployment VM after merge, following the runbook's upgrade steps.
Checklist