Skip to content

fix: start schema_version at 0 so migrations begin from version 1#18

Merged
johnny-emp merged 2 commits intomainfrom
fix/migration-version-start-at-zero
Feb 5, 2026
Merged

fix: start schema_version at 0 so migrations begin from version 1#18
johnny-emp merged 2 commits intomainfrom
fix/migration-version-start-at-zero

Conversation

@johnny-emp
Copy link
Contributor

Summary

  • Fixes a bug where migrations starting from version 1 were skipped
  • The schema_version was previously initialized to 1, but the filter uses version > current_version, so version 1 migrations never ran
  • Users were forced to start migrations from version 2, which was confusing

Changes

  • Initialize schema_version to 0 in SQLite, LMDB, and core meta types
  • Update the generate function to start at version 1 for new migrations
  • Update documentation and examples to reflect version 1 as the first migration
  • Update rollback error message to reflect version 0 as initial state
  • Update all tests to use version 1 as the first migration

Test plan

  • All existing tests pass
  • Migration tests updated to use version 1
  • Integration test for schema_version updated

Previously, schema_version was initialized to 1, which meant that
migrations starting from version 1 would be skipped (since the filter
uses `version > current_version`). This forced users to start their
migrations from version 2, which was confusing and undocumented.

This change:
- Initializes schema_version to 0 in SQLite, LMDB, and core meta types
- Updates the generate function to start at version 1 for new migrations
- Updates documentation and examples to reflect version 1 as the first
- Updates rollback error message to reflect version 0 as initial state
- Updates all tests to use version 1 as the first migration
@johnny-emp johnny-emp merged commit 05fef67 into main Feb 5, 2026
8 checks passed
@johnny-emp johnny-emp deleted the fix/migration-version-start-at-zero branch February 5, 2026 21:55
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