Skip to content

fix: preserve schema order when adding columns#316

Merged
KKould merged 1 commit intomainfrom
fix/add-column-schema-order
Mar 29, 2026
Merged

fix: preserve schema order when adding columns#316
KKould merged 1 commit intomainfrom
fix/add-column-schema-order

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented Mar 29, 2026

Summary

  • keep newly added column ids strictly after all existing column ids
  • prevent schema reload from reordering columns after ALTER TABLE ADD COLUMN
  • add a regression test covering the column id ordering invariant

Why

The flaky test_model_migrate failure came from schema order drifting from id,name,age to id,age,name after ADD COLUMN, which made tuple decoding read the row with the wrong layout and triggered UnexpectedEof.

Verification

  • cargo test test_add_column_generates_id_after_existing_columns -- --nocapture
  • cargo test -p macros-test test_model_migrate -- --nocapture

@KKould KKould self-assigned this Mar 29, 2026
@KKould KKould added the bug Something isn't working label Mar 29, 2026
@KKould KKould merged commit 585ae80 into main Mar 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant