Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

23 lines · 911 BRaw History
1-- Hosted compute an account pays for (the owner of the repository): Actions jobs on hosted runners
2-- and agent sandboxes. A row is open until the job or sandbox ends (lib/quotas.ts).
3CREATE TABLE IF NOT EXISTS compute_usage (
4 id TEXT PRIMARY KEY,
5 account_id TEXT NOT NULL,
6 repo_id TEXT NOT NULL,
7 kind TEXT NOT NULL,
8 started_at TEXT NOT NULL,
9 ended_at TEXT
10);
11CREATE INDEX IF NOT EXISTS compute_usage_open ON compute_usage(account_id, kind, ended_at);
12CREATE INDEX IF NOT EXISTS compute_usage_started ON compute_usage(account_id, started_at);
13
14-- A site administrator's per-account overrides of the default quotas; NULL keeps the default, -1 is unlimited.
15CREATE TABLE IF NOT EXISTS account_quotas (
16 account_id TEXT PRIMARY KEY REFERENCES accounts(id),
17 hosted_minutes INTEGER,
18 hosted_jobs INTEGER,
19 sandboxes INTEGER,
20 repositories INTEGER,
21 updated_at TEXT NOT NULL,
22 updated_by TEXT
23);