Fix missing Btime in file export - #181
Merged
Merged
Conversation
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
force-pushed
the
fix-180-missing-btime-export
branch
from
August 30, 2026 09:04
e501a1a to
d813355
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileTime.Btimewas read from the filesystem intimes.gobut never assigned toFileMD, and thefilestable had no column for it — the value was lost before it ever reached the DB, TSV export, or the JSONL export.filebtimecolumn to thefilestable, 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).jsonl.go), which had the same gap despite its doc comment promising the "full files table row".admftrove --updatedbmigration step (1.0.0-BETA-9→1.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 thehierarchycolumn. Also adds a fallback log message when no update path matches a version (previously silent for BETA-5..BETA-8).Filectime, the change time, not the creation time) so it isn't confused with the new "Birth" row.TestFileRoundTripindb_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 positionalVALUES(?,?,?...)SQL statements.Fixes #180
Note:
1.0.0-BETA-10in 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)webftroveagainst 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