internal/store/migrations/0028_deps.up.sql

dca7370cd168dc7cf1f262252ab9548f66cc7dcc
gitbay/internal/store/migrations/0028_deps.up.sql history · blame · raw

25 lines · 1050 bytes

 1-- Dependency update checks: an opt-in per-repo sweep that compares the
 2-- manifests on the default branch against upstream registries and reports
 3-- what is behind in an issue. Opt-in because checking a private repo tells
 4-- a public registry what it depends on.
 5CREATE TABLE dep_checks (
 6    repo_id      INTEGER PRIMARY KEY REFERENCES repos(id) ON DELETE CASCADE,
 7    last_check   TEXT NOT NULL DEFAULT '',
 8    last_error   TEXT NOT NULL DEFAULT '',
 9    issue_number INTEGER NOT NULL DEFAULT 0
10);
11
12-- What each repo was last told about, so a repo that stays behind is
13-- reported once rather than every sweep.
14CREATE TABLE dep_reports (
15    repo_id   INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
16    ecosystem TEXT NOT NULL,
17    name      TEXT NOT NULL,
18    current   TEXT NOT NULL,
19    latest    TEXT NOT NULL,
20    PRIMARY KEY (repo_id, ecosystem, name)
21);
22
23-- The account dependency issues are authored by. Keyless and mailless: it
24-- authors, it never authenticates.
25INSERT INTO users (username, is_admin) VALUES ('gitbay-bot', 0);