feat(backend): add commits schema and update_db snapshot (#2089) - #2106
Open
alanpeixinho wants to merge 3 commits into
Open
alanpeixinho wants to merge 3 commits into
alanpeixinho wants to merge 3 commits into
Conversation
Member
|
looking good. |
This was referenced Sep 10, 2026
Contributor
Author
Up until now, we have always directly merged to main. But it might be a good idea to have feature branches for such cases. |
4 tasks
6 tasks
* Add `Commits` model: unique `git_commit_hash`, nullable author/committer/subject/message/`fetched_from_url` * Add `CommitParents` model: FKs to `commits.id`, `ord` with 0 = first parent, unique `(commit_id, ord)` * Add migration `0021_commits_and_commit_parents` (`commits`, `commit_parents` tables and indexes) * Join from `checkouts.git_commit_hash` without new checkout columns Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Dump commits and commit_parents in full so git ancestry survives restore. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
…ci#2089) Keep commits rows narrow: unique git name/email in commit_identity, subject plus UTF-8 body in commit_message as bytea. update_db dumps and restores the new tables and still accepts a flat legacy commits CSV.
alanpeixinho
force-pushed
the
feat/2089-commits-schema
branch
from
September 23, 2026 12:58
bc370a8 to
3b018c1
Compare
This branch has not been deployed
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.
What it is
Add a
commitstable (intPK, uniquegit_commit_hash, nullable author/committer/subject/message/fetched_from_url) andcommit_parents(ord=0= first parent, unique(commit_id, ord)). Checkouts join ongit_commit_hash.update_dbsnapshots and restores both tables in full (no time or origin window) so ancestors without a checkout in the interval stay in the first-parent chain. Rows stream inSELECT_BATCH_SIZEbatches. Surrogate ids are kept.Closes #2089
How to test
0021. Confirmcommitsandcommit_parentsexist.update_db snapshotwith a tight--start-interval. Commits and parents should still be the full tables.Made with Cursor