Skip to content

Commit e12b034

Browse files
committed
feat(db): implement migration framework and add profile management
- Introduced a new `migrations` module to handle database schema migrations. - Added baseline schema creation and several migration functions to update existing tables. - Enhanced the `initialize` function to apply migrations on database initialization. - Implemented profile management with the ability to switch profiles and migrate legacy databases. - Updated `UsageGoal` model to include `notify_risk` field with default value. - Modified database queries to accommodate new columns and structures. - Added new API endpoints for profile management and migration status checks.
1 parent 45d8b4c commit e12b034

9 files changed

Lines changed: 1814 additions & 73 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77

88
## [2.0.0] - 2026-06-06
99

10+
### Added
11+
12+
- **Unified migration runner** — replaced ad-hoc `ALTER TABLE` checks with a numbered migration framework using `PRAGMA user_version`, a `_migration_log` table, and `pre-check` / `apply` / `post-verify` phases.
13+
- **Migration rehearsal command** — `run_migration_rehearsal` copies the live database to a temporary path, runs all pending migrations, and returns a health report without modifying production data.
14+
- **Migration status command** — `get_migration_status` exposes current, latest, and pending migration versions.
15+
- **Roadmap-aligned data health commands** — added `check_data_integrity`, `scan_data_gaps`, and `check_orphan_rows` to match the v1.2.0 roadmap command surface.
16+
- **Profile-aware database layout** — databases now live under `app_data/profiles/<profile_id>/timelens.db`. Added `list_profiles`, `create_profile`, `switch_profile`, and `get_current_profile` commands.
17+
- **Cross-platform legacy 1.x migration** — startup now detects legacy database paths on Windows, macOS, and Linux and migrates them into the default profile.
18+
- **Restore monitoring active state on startup** — monitor no longer defaults to active when the user had paused tracking before quitting.
19+
- **Backup & Restore v2 completeness** — backup packages now include app categories, usage goals, focus sessions/rules, browser ignored domains/limits, widget permissions/audit log, VS Code sessions, API tokens, and client allowlist.
20+
1021
### Changed
1122

1223
- Consolidated roadmap governance into a single canonical local-first source at `docs/ROADMAP_v2.0.0.md`.

‎PRIVACY_POLICY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ TimeLens is an open-source project. You are welcome to inspect the source code t
250250
If you have any questions, concerns, or requests regarding this Privacy Policy or our data practices, please contact us:
251251

252252
- **GitHub Issues:** [https://github.com/seans/TimeLens/issues](https://github.com/seans/TimeLens/issues)
253-
- **Email:** privacy@timelens.app *(placeholder—update with real contact if available)*
253+
- **Email:** timelens@xmoj-script.uk
254254

255255
We will make every effort to respond to legitimate inquiries within 30 days.
256256

‎browser-extension (2).zip‎

-33.8 KB
Binary file not shown.

‎src-tauri/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ sha2 = "0.10"
4040
hmac = "0.12"
4141
hex = "0.4"
4242
zip = "0.6"
43+
zstd = "0.13"
4344
axum = { version = "0.7", features = ["ws"] }
4445
tower-http = { version = "0.5", features = ["cors"] }
4546
tokio-tungstenite = { version = "0.21", optional = true }

0 commit comments

Comments
 (0)