OXYGENHUB
# f2d2776b2a14 oxygenhub / crates / hub / migrations / 0103_attachments.sql
636 B · SQL · last changed OxygenHub 0.9.19: attachments on issues and comments, over the API and oh --attach; images by their bytes shown in place, everything else a download (closes #350) 4 days ago source blame history raw
1c52d940 Andy McCall ↶ 1
-- Files attached to issues, comments and proposals (oxygenhub#350): kept by
2
-- content in the hub's assets store, as release assets are, and served
3
-- under the repository's read rules.
4
CREATE TABLE attachments (
5
    id           INTEGER PRIMARY KEY,
6
    repo_id      INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
7
    name         TEXT NOT NULL,
8
    size         INTEGER NOT NULL,
9
    hash         TEXT NOT NULL,
10
    content_type TEXT NOT NULL,
11
    uploader_id  INTEGER,
12
    created_ms   INTEGER NOT NULL
13
);
14
CREATE INDEX attachments_repo ON attachments (repo_id);
15
CREATE INDEX attachments_hash ON attachments (hash);