| 1 | -- Files put in an issue's, a pull request's or a comment's Markdown |
| 2 | -- (attachments.rs). Their bytes are in the usercontent namespace |
| 3 | -- (AVATARS) under `attachments/<id>`, served by the usercontent origin at |
| 4 | -- /attachments/<id>; these rows say whose repository each belongs to, so |
| 5 | -- a purged repository's go with it. |
| 6 | CREATE TABLE attachments ( |
| 7 | id TEXT PRIMARY KEY, |
| 8 | repo_id TEXT NOT NULL, |
| 9 | user_id TEXT NOT NULL, |
| 10 | name TEXT NOT NULL, |
| 11 | content_type TEXT NOT NULL, |
| 12 | size INTEGER NOT NULL, |
| 13 | created_at TEXT NOT NULL |
| 14 | ); |
| 15 | |
| 16 | CREATE INDEX attachments_by_repo ON attachments (repo_id); |