Fix Int16 cast and DuckDB migration ordering#313
Merged
erikdarlingdata merged 1 commit intodevfrom Feb 26, 2026
Merged
Conversation
…ering - NocHealth: session_id is smallint in DMVs, use Convert.ToInt32 instead of reader.GetInt32 to avoid "Unable to cast System.Int16 to System.Int32" - DuckDbInitializer: run CREATE TABLE before ALTER TABLE migrations so migrations don't fail against nonexistent tables after archive-and-reset Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
erikdarlingdata
added a commit
that referenced
this pull request
Feb 26, 2026
The previous fix (PR #313) moved CREATE TABLE before migrations, but migrations v2/v6/v7/v8 DROP TABLE IF EXISTS then expect CREATE TABLE to follow — so tables were created then immediately dropped. Correct fix: skip migrations entirely on fresh/reset databases (v0). When existingVersion is 0, there's nothing to migrate — just create tables with the current schema and stamp the version. Fixes CI test failures: InitializeAsync_CreatesAllTables, InitializeAsync_CreatesIndexes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
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.
Summary
Unable to cast System.Int16 to System.Int32in long-running query alert polling (session_idissmallintin DMVs)ALTER TABLE ... Table does not existerrors after archive-and-reset by running CREATE TABLE before migrationsTest plan