Migrations on SQLite run without the "cannot be executed in a transaction" warnings #289

Merged
claude merged 2 commits from feature/21-sqlite-migration-warnings into develop 2026-11-05 06:00:50 -05:00
Owner

A fresh SQLite install no longer logs EF Core's "migration operation cannot be executed in a transaction" warnings. The table-rebuild migrations emit PRAGMA foreign_keys = 0, which SQLite cannot run inside a transaction; the warning describes EF Core's behaviour, not a problem with the database.

  • UseNinlilDnsSqlite logs RelationalEventId.NonTransactionalMigrationOperationWarning at Debug, the same way QuietCommandLogging treats CommandExecuted. Only that one event id is affected, on SQLite only (runtime and design-time factory). Other migration warnings and other providers are unchanged.
  • A comment says why hiding it is safe. The migrator snapshots an existing database first, or logs its own warning when Storage:MigrationSafety:TakeSnapshot is off, and a fresh database has nothing to lose.

Tests:

  • Sqlite/SqliteMigrationWarningTests migrates a new file through RelationalStartupMigrator. It asserts that migration log entries exist and that none of them is a Warning.
  • It was red before the change, failing on the PRAGMA warning.
  • The no-Docker part of Ninlil.Dns.Data.Integration.Tests passes 81 tests.
  • The verifier passed the change. Its comment-precision finding is fixed in the last commit.

Closes #21

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

A fresh SQLite install no longer logs EF Core's "migration operation cannot be executed in a transaction" warnings. The table-rebuild migrations emit `PRAGMA foreign_keys = 0`, which SQLite cannot run inside a transaction; the warning describes EF Core's behaviour, not a problem with the database. - `UseNinlilDnsSqlite` logs `RelationalEventId.NonTransactionalMigrationOperationWarning` at Debug, the same way `QuietCommandLogging` treats `CommandExecuted`. Only that one event id is affected, on SQLite only (runtime and design-time factory). Other migration warnings and other providers are unchanged. - A comment says why hiding it is safe. The migrator snapshots an existing database first, or logs its own warning when `Storage:MigrationSafety:TakeSnapshot` is off, and a fresh database has nothing to lose. Tests: - `Sqlite/SqliteMigrationWarningTests` migrates a new file through `RelationalStartupMigrator`. It asserts that migration log entries exist and that none of them is a Warning. - It was red before the change, failing on the PRAGMA warning. - The no-Docker part of `Ninlil.Dns.Data.Integration.Tests` passes 81 tests. - The verifier passed the change. Its comment-precision finding is fixed in the last commit. Closes #21 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The SQLite migration warning comment says the migrator warns when snapshots are switched off
Some checks failed
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Test .NET (pull_request) Failing after 19m5s
Build / Pack and Push NuGet Packages (common) (pull_request) Has been skipped
Build / Stage Draft Release (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been skipped
Build / Build Binary (linux-amd64) (pull_request) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (pull_request) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Has been skipped
Build / Build and Test Deb and RPM Packages (pull_request) Has been skipped
Build / Build Arch Linux Packages (pull_request) Has been skipped
Build / Build and Push Image (pull_request) Has been skipped
Build / Smoke Test the Windows Binary (pull_request) Has been skipped
Build / Pipeline (pull_request) Failing after 0s
Build / Publish Release (pull_request) Has been skipped
0b2412a46a
Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit ef7dac3c0f into develop 2026-11-05 06:00:50 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!289
No description provided.