Add a last_accessed column to project branches. · JavaDerek/unison@93c67a9 · GitHub
Skip to content

Commit 93c67a9

Browse files
committed
Add a last_accessed column to project branches.
1 parent 6b1b58d commit 93c67a9

5 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs‎

Lines changed: 13 additions & 1 deletion
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- Add a new column to the project_branch table to store the last time that project branch was accessed.
2+
-- This column is stored as a unix epoch time.
3+
ALTER TABLE project_branch ADD COLUMN last_accessed INTEGER NOT NULL DEFAULT (strftime('%s', 'now'));

‎codebase2/codebase-sqlite/unison-codebase-sqlite.cabal‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22

3-
-- This file has been generated from package.yaml by hpack version 0.36.0.
3+
-- This file has been generated from package.yaml by hpack version 0.37.0.
44
--
55
-- see: https://github.com/sol/hpack
66

@@ -24,6 +24,7 @@ extra-source-files:
2424
sql/012-add-current-project-path-table.sql
2525
sql/013-add-project-branch-reflog-table.sql
2626
sql/014-add-project-branch-causal-hash-id.sql
27+
sql/015-add-project-branch-last-accessed.sql
2728
sql/create.sql
2829

2930
source-repository head

‎parser-typechecker/src/Unison/Codebase/SqliteCodebase/Migrations.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ migrations regionVar getDeclType termBuffer declBuffer rootCodebasePath =
8484
sqlMigration 14 Q.addSquashResultTable,
8585
sqlMigration 15 Q.addSquashResultTableIfNotExists,
8686
sqlMigration 16 Q.cdToProjectRoot,
87-
(17 {- This migration takes a raw sqlite connection -}, \conn -> migrateSchema16To17 conn)
87+
(17 {- This migration takes a raw sqlite connection -}, \conn -> migrateSchema16To17 conn),
88+
sqlMigration 18 Q.addProjectBranchLastAccessedColumn
8889
]
8990
where
9091
runT :: Sqlite.Transaction () -> Sqlite.Connection -> IO ()

‎parser-typechecker/src/Unison/Codebase/SqliteCodebase/Operations.hs‎

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)