Skip to content

Commit 953eb03

Browse files
committed
Back out "Disable saving of depth on new entities until migration is done"
This backs out commit 3ff6546.
1 parent 5ff5ea5 commit 953eb03

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
lines changed

src/Share/Postgres/Causal/Queries.hs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,7 @@ savePgNamespace maySerialized mayBh b@(BranchFull.Branch {terms, types, patches,
642642
|]
643643
-- Note: this must be run AFTER inserting the namespace and all its children.
644644
execute_ [sql| SELECT save_namespace(#{bhId}) |]
645-
646-
-- Disabled while migration is running so we don't accidentally get incorrect depths
647-
-- from missing depth dependencies
648-
-- execute_ [sql| SELECT update_namespace_depth(#{bhId}) |]
645+
execute_ [sql| SELECT update_namespace_depth(#{bhId}) |]
649646

650647
saveSerializedNamespace :: (QueryM m) => BranchHashId -> CBORBytes TempEntity -> m ()
651648
saveSerializedNamespace bhId (CBORBytes bytes) = do
@@ -789,9 +786,7 @@ saveCausal maySerializedCausal mayCh bhId ancestorIds = do
789786
SELECT #{cId}, a.ancestor_id
790787
FROM ancestors a
791788
|]
792-
-- Disabled while migration is running so we don't accidentally get incorrect depths
793-
-- from missing depth dependencies
794-
-- execute_ [sql| SELECT update_causal_depth(#{cId}) |]
789+
execute_ [sql| SELECT update_causal_depth(#{cId}) |]
795790
pure cId
796791

797792
saveSerializedCausal :: (QueryM m) => CausalId -> CBORBytes TempEntity -> m ()

src/Share/Postgres/Definitions/Queries.hs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,10 @@ saveEncodedTermComponent componentHash maySerialized elements = do
863863
SELECT defn_mappings.term_id, defn_mappings.local_index, defn_mappings.component_hash_id
864864
FROM defn_mappings
865865
|]
866-
-- Disabled while migration is running so we don't accidentally get incorrect depths
867-
-- from missing depth dependencies
868-
-- execute_
869-
-- [sql|
870-
-- SELECT update_component_depth(#{componentHashId})
871-
-- |]
866+
execute_
867+
[sql|
868+
SELECT update_component_depth(#{componentHashId})
869+
|]
872870
pure termIds
873871

874872
saveTypeComponent :: ComponentHash -> Maybe TempEntity -> [(PgLocalIds, DeclFormat.Decl Symbol)] -> CodebaseM e ()
@@ -1019,12 +1017,10 @@ saveTypeComponent componentHash maySerialized elements = do
10191017
FROM defn_mappings
10201018
|]
10211019
saveConstructors (zip (toList typeIds) elements)
1022-
-- Disabled while migration is running so we don't accidentally get incorrect depths
1023-
-- from missing depth dependencies
1024-
-- execute_
1025-
-- [sql|
1026-
-- SELECT update_component_depth(#{componentHashId})
1027-
-- |]
1020+
execute_
1021+
[sql|
1022+
SELECT update_component_depth(#{componentHashId})
1023+
|]
10281024
pure typeIds
10291025

10301026
-- | Efficiently resolve all pg Ids across selected Local Ids.

src/Share/Postgres/Patches/Queries.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ savePatch maySerialized patchHash PatchFull.Patch {termEdits, typeEdits} = do
233233
LEFT JOIN types to_type
234234
ON to_type.component_hash_id = to_type_component_hash_id AND to_type.component_index = to_type_component_index
235235
|]
236-
-- Disabled while migration is running so we don't accidentally get incorrect depths
237-
-- from missing depth dependencies
238-
-- execute_ [sql| SELECT update_patch_depth(#{patchId}) |]
236+
execute_ [sql| SELECT update_patch_depth(#{patchId}) |]
239237
pure patchId
240238
termsTable :: [(Maybe ComponentHashId, Maybe Int64 {- from comp index -}, Maybe TextId, Maybe ComponentHashId, Maybe Int64 {- to comp index -}, Maybe TextId, Maybe PatchFullTermEdit.Typing, Bool)]
241239
constructorsTable :: [(ComponentHashId, Int64 {- from comp index -}, Int64 {- from constr index -}, Maybe ComponentHashId, Maybe Int64 {- to comp index-}, Maybe Int64 {- to constr index -}, Maybe PatchFullTermEdit.Typing, Bool)]

0 commit comments

Comments
 (0)