mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-04 05:37:14 +03:00
add migration to cd up to current project root
This commit is contained in:
parent
4f4ed49831
commit
ecd323faa7
@ -251,6 +251,7 @@ module U.Codebase.Sqlite.Queries
|
||||
addMostRecentNamespaceTable,
|
||||
addSquashResultTable,
|
||||
addSquashResultTableIfNotExists,
|
||||
cdToProjectRoot,
|
||||
|
||||
-- ** schema version
|
||||
currentSchemaVersion,
|
||||
@ -411,7 +412,7 @@ type TextPathSegments = [Text]
|
||||
-- * main squeeze
|
||||
|
||||
currentSchemaVersion :: SchemaVersion
|
||||
currentSchemaVersion = 15
|
||||
currentSchemaVersion = 16
|
||||
|
||||
createSchema :: Transaction ()
|
||||
createSchema = do
|
||||
@ -475,6 +476,10 @@ addSquashResultTableIfNotExists :: Transaction ()
|
||||
addSquashResultTableIfNotExists =
|
||||
executeStatements $(embedProjectStringFile "sql/010-ensure-squash-cache-table.sql")
|
||||
|
||||
cdToProjectRoot :: Transaction ()
|
||||
cdToProjectRoot =
|
||||
executeStatements $(embedProjectStringFile "sql/011-cd-to-project-root.sql")
|
||||
|
||||
schemaVersion :: Transaction SchemaVersion
|
||||
schemaVersion =
|
||||
queryOneCol
|
||||
|
5
codebase2/codebase-sqlite/sql/011-cd-to-project-root.sql
Normal file
5
codebase2/codebase-sqlite/sql/011-cd-to-project-root.sql
Normal file
@ -0,0 +1,5 @@
|
||||
-- As part of deprecating cd, we want users who have cd'd deeper than their project root to be parked at the root instead.
|
||||
UPDATE "most_recent_namespace"
|
||||
SET "namespace" = json_array("namespace" -> 0, "namespace" -> 1, "namespace" -> 2, "namespace" -> 3)
|
||||
WHERE "namespace" ->> 0 = '__projects'
|
||||
AND json_array_length("namespace") > 4;
|
@ -1,6 +1,6 @@
|
||||
cabal-version: 1.12
|
||||
|
||||
-- This file has been generated from package.yaml by hpack version 0.35.2.
|
||||
-- This file has been generated from package.yaml by hpack version 0.36.0.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
|
||||
@ -20,6 +20,7 @@ extra-source-files:
|
||||
sql/008-add-most-recent-namespace-table.sql
|
||||
sql/009-add-squash-cache-table.sql
|
||||
sql/010-ensure-squash-cache-table.sql
|
||||
sql/011-cd-to-project-root.sql
|
||||
sql/create.sql
|
||||
|
||||
source-repository head
|
||||
|
@ -80,7 +80,8 @@ migrations getDeclType termBuffer declBuffer rootCodebasePath =
|
||||
(12, migrateSchema11To12),
|
||||
sqlMigration 13 Q.addMostRecentNamespaceTable,
|
||||
sqlMigration 14 Q.addSquashResultTable,
|
||||
sqlMigration 15 Q.addSquashResultTableIfNotExists
|
||||
sqlMigration 15 Q.addSquashResultTableIfNotExists,
|
||||
sqlMigration 16 Q.cdToProjectRoot
|
||||
]
|
||||
where
|
||||
sqlMigration :: SchemaVersion -> Sqlite.Transaction () -> (SchemaVersion, Sqlite.Transaction ())
|
||||
|
Loading…
Reference in New Issue
Block a user