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.

16 lines · 1.3 KBRaw History
1-- Indexes for D1 queries that scanned whole tables as they grew (scalability evaluation, 2026-10-14).
2-- Suspended people, read on every issue and pull request page (lib/moderation.ts suspendedIds).
3CREATE INDEX IF NOT EXISTS accounts_suspended ON accounts(suspended_at) WHERE suspended_at IS NOT NULL;
4-- Pending invitations by address, read at every sign-up and sign-in (lib/directory.ts).
5CREATE INDEX IF NOT EXISTS invites_email ON invites(email);
6-- An owner's imports in progress (lib/directory.ts), and the cron that expires drafts.
7CREATE INDEX IF NOT EXISTS imports_target_owner ON imports(target_owner_id, status);
8CREATE INDEX IF NOT EXISTS imports_status ON imports(status, created_at);
9-- Token expiry reminders (mail/notify.ts mailCron, every five minutes).
10CREATE INDEX IF NOT EXISTS tokens_expires ON tokens(expires_at);
11-- Container registry cleanup (registry/store.ts, every five minutes).
12CREATE INDEX IF NOT EXISTS registry_blobs_created ON registry_blobs(created_at);
13CREATE INDEX IF NOT EXISTS package_blobs_created ON package_blobs(created_at);
14-- Retention (lib/retention.ts): expired sessions and old notifications are deleted.
15CREATE INDEX IF NOT EXISTS sessions_expires ON sessions(expires_at);
16CREATE INDEX IF NOT EXISTS notifications_created ON notifications(created_at);