Skip to content

Fix missing Btime in file export - #181

Merged
steffenfritz merged 3 commits into
mainfrom
fix-180-missing-btime-export
Aug 30, 2026
Merged

Fix missing Btime in file export#181
steffenfritz merged 3 commits into
mainfrom
fix-180-missing-btime-export

Conversation

@steffenfritz

Copy link
Copy Markdown
Owner

Summary

  • FileTime.Btime was read from the filesystem in times.go but never assigned to FileMD, and the files table had no column for it — the value was lost before it ever reached the DB, TSV export, or the JSONL export.
  • Adds a filebtime column to the files table, populates it during the scan (cmd/ftrove/main.go), and surfaces it in webtrove (new "Birth" column in the file list, new row in the file detail page).
  • Fixes the JSONL exporter's own hand-written column list (jsonl.go), which had the same gap despite its doc comment promising the "full files table row".
  • Adds an admftrove --updatedb migration step (1.0.0-BETA-91.0.0-BETA-10, ALTER TABLE files ADD filebtime TEXT) so existing installed databases keep working after a binary upgrade, following the same pattern used previously for the hierarchy column. Also adds a fallback log message when no update path matches a version (previously silent for BETA-5..BETA-8).
  • Renamed the "Created" label in the file detail page to "Changed" (it shows Filectime, the change time, not the creation time) so it isn't confused with the new "Birth" row.
  • Adds column-name-keyed round-trip tests (TestFileRoundTrip in db_test.go, webdb_test.go) that assert each column lands in the right place — these caught the JSONL exporter gap during development, since it's a real risk with this codebase's positional VALUES(?,?,?...) SQL statements.

Fixes #180

Note: 1.0.0-BETA-10 in the migration step is a placeholder guess for the next release version — please confirm/adjust before release if versioned differently.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./... (including new regression tests)
  • Manual smoke test: seeded a test DB, ran webftrove against it, confirmed the "Birth" column/row renders correctly on both the session file list and file detail pages

🤖 Generated with Claude Code

https://claude.ai/code/session_016LuzoNZRdFhBDgS97zYjzU

steffenfritz and others added 3 commits August 30, 2026 09:54
Merge branch 'main' of github.com:steffenfritz/FileTrove
FileTime.Btime was read from the filesystem but never assigned to
FileMD, and the files table had no column for it, so birth time was
lost before it ever reached the TSV/JSONL export or the database.

Adds a filebtime column to the files table, populates it during the
scan, surfaces it in webtrove (file list + detail page), and fixes the
JSONL exporter's own hand-written column list which had the same gap.
Includes an admftrove --updatedb migration step and column-name-keyed
round-trip tests guarding against future column misalignment in the
positional SQL statements.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LuzoNZRdFhBDgS97zYjzU
@steffenfritz
steffenfritz force-pushed the fix-180-missing-btime-export branch from e501a1a to d813355 Compare August 30, 2026 09:04
@steffenfritz steffenfritz self-assigned this Aug 30, 2026
@steffenfritz
steffenfritz merged commit 8e789c3 into main Aug 30, 2026
7 checks passed
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.

[BUG] Missing Btime in Export

1 participant