1-- One row per tag. The tarball lives in R2 under <package>/<sha256>.tgz and
2-- exists for as long as any row points at it.
3--
4-- expires_at is refreshed by every publication of the tag. linked_prs is the
5-- JSON list of "owner/repo#N" pull requests whose runs produced the tag; the
6-- sweep keeps those rows alive while any of them is open and pins expiry to
7-- close time plus TTL once they all close. A mirrored commit tag is shared by
8-- every pull request that pins that submodule commit, which is why this is
9-- a list and not a column.
10CREATE TABLE tags (
11 package TEXT NOT NULL,
12 tag TEXT NOT NULL,
13 sha256 TEXT NOT NULL,
14 expires_at INTEGER NOT NULL,
15 linked_prs TEXT NOT NULL DEFAULT '[]',
16 PRIMARY KEY (package, tag)
17);
18CREATE INDEX tags_expires_at ON tags (expires_at);
19CREATE INDEX tags_sha256 ON tags (package, sha256);