Skip to content

Commit

Permalink
Add remote head hash in new codebases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Feb 13, 2025
1 parent e376745 commit 1e9cb6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4165,7 +4165,7 @@ ensureRemoteProjectBranch rpid host rbid name lastKnownCausalHash =
host,
branch_id,
name,
last_known_head)
last_known_causal_hash)
VALUES (
:rpid,
:host,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Add a field for tracking the latest known causal hash for each remote project branch.
-- It's helpful for when we need to tell Share how much we know about a branch.

ALTER TABLE remote_project
ALTER TABLE remote_project_branch
-- Note that there isn't a guarantee this hash has actually been synced into the codebase.
ADD COLUMN last_known_causal_hash INTEGER NULL REFERENCES hash(id)
ON DELETE SET NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ createSchema = do
(_, emptyCausalHashId) <- emptyCausalHash
(_, ProjectBranch {projectId, branchId}) <- insertProjectAndBranch scratchProjectName scratchBranchName emptyCausalHashId
Q.setCurrentProjectPath projectId branchId []
Q.trackLatestRemoteHead
where
scratchProjectName = UnsafeProjectName "scratch"
scratchBranchName = UnsafeProjectBranchName "main"
Expand Down

0 comments on commit 1e9cb6c

Please sign in to comment.