Skip to content

Add upgrade module for migrating older databases to current schema#4

Merged
simonw merged 3 commits intomainfrom
claude/database-schema-upgrade-dioif
Feb 9, 2026
Merged

Add upgrade module for migrating older databases to current schema#4
simonw merged 3 commits intomainfrom
claude/database-schema-upgrade-dioif

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Feb 9, 2026

Databases created before change-grouping support was added are missing
the [group] column on audit tables and the _history_json groups table.
This adds a python -m sqlite_history_json.upgrade database.db command
that detects and applies the necessary schema changes (with --dry-run
support). It adds the groups table, the [group] FK column, and recreates
triggers to populate it.

https://claude.ai/code/session_01QuKekf3igCVVD8KqVK5yMK

Databases created before change-grouping support was added are missing
the [group] column on audit tables and the _history_json groups table.
This adds a `python -m sqlite_history_json.upgrade database.db` command
that detects and applies the necessary schema changes (with --dry-run
support). It adds the groups table, the [group] FK column, and recreates
triggers to populate it.

https://claude.ai/code/session_01QuKekf3igCVVD8KqVK5yMK
Demonstrates upgrading a database created with 0.3a0 (pre-grouping)
to the current schema using the new upgrade module. Shows the full
lifecycle: old-style tracking, schema inspection, dry-run, upgrade,
post-upgrade grouped changes.

https://claude.ai/code/session_01QuKekf3igCVVD8KqVK5yMK
@simonw simonw merged commit d022f80 into main Feb 9, 2026
10 checks passed
simonw added a commit that referenced this pull request Feb 9, 2026
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.

2 participants