flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/services/repos/migrations/0010_refs_version.sql

14 lines865 bytesCodeBlame
1-- Where a repository's refs stand, for the answers that list them, which
2-- git asks for first on every clone and fetch and which are kept for a
3-- moment (src/refs_cache.rs).
4--
5-- refs_version: goes up after everything g1t does that changes the refs:
6-- a push through git over HTTPS, a merge, a pull request brought up to
7-- date, a branch deleted or renamed, the default branch changed, a mirror
8-- catching up, an import. An answer is kept under the version it was
9-- made at, so a change leaves it behind.
10-- refs_open_until: milliseconds since the epoch. Set when a credential
11-- that can push is handed out of g1t's hands (`git_access`); until then
12-- nothing is kept, because a push with it would not move the version.
13ALTER TABLE repos ADD COLUMN refs_version INTEGER NOT NULL DEFAULT 0;
14ALTER TABLE repos ADD COLUMN refs_open_until INTEGER;