g1t/services/repos/migrations/0010_refs_version.sql
| 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. |
| 13 | ALTER TABLE repos ADD COLUMN refs_version INTEGER NOT NULL DEFAULT 0; |
| 14 | ALTER TABLE repos ADD COLUMN refs_open_until INTEGER; |