-- Files attached to issues, pull requests, comments and discussions through the markdown -- editors. The bytes live in blob storage under `attachments/`; this row is the metadata -- and the repo link that access checks use. Applied by store/migrate.rs. CREATE TABLE attachments ( id TEXT PRIMARY KEY, repo_id TEXT NOT NULL REFERENCES repos(id) ON DELETE CASCADE, uploader_id TEXT NOT NULL REFERENCES users(id), name TEXT NOT NULL, content_type TEXT NOT NULL, size INTEGER NOT NULL, sha256 TEXT NOT NULL, created_at TEXT NOT NULL ); CREATE INDEX attachments_repo ON attachments(repo_id);