diff --git a/codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs b/codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs index 4b223e2385..e163e1cd26 100644 --- a/codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs +++ b/codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs @@ -4165,7 +4165,7 @@ ensureRemoteProjectBranch rpid host rbid name lastKnownCausalHash = host, branch_id, name, - last_known_head) + last_known_causal_hash) VALUES ( :rpid, :host, diff --git a/codebase2/codebase-sqlite/sql/016-track-latest-remote-head.sql b/codebase2/codebase-sqlite/sql/016-track-latest-remote-head.sql index cb92fb4eb3..bb220e9441 100644 --- a/codebase2/codebase-sqlite/sql/016-track-latest-remote-head.sql +++ b/codebase2/codebase-sqlite/sql/016-track-latest-remote-head.sql @@ -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; diff --git a/parser-typechecker/src/Unison/Codebase/SqliteCodebase/Operations.hs b/parser-typechecker/src/Unison/Codebase/SqliteCodebase/Operations.hs index cef8475cbf..40f499b52f 100644 --- a/parser-typechecker/src/Unison/Codebase/SqliteCodebase/Operations.hs +++ b/parser-typechecker/src/Unison/Codebase/SqliteCodebase/Operations.hs @@ -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"