~raboof/nixpkgs-contributor-dashboard

ref: bd4d138597768987abb3dda5987537c8bed8806a nixpkgs-contributor-dashboard/src/models.rs -rw-r--r-- 568 bytes
bd4d1385 — Arnout Engelen Include html link 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use super::schema::items;

#[derive(Queryable)]
pub struct Item {
    pub id: i32,
    // 'PR', 'ISSUE' or 'BUILD'
    pub kind: String,
    // 1 if draft PR, 0 otherwise
    pub draft: i32,
    pub number: i32,
    pub package: String,
    pub title: String,
    pub html_url: String,
}

#[derive(Insertable)]
#[table_name="items"]
pub struct NewItem<'a> {
    // 'PR' or 'BUILD'
    pub kind: &'a str,
    // For PR's, 1 if draft, 0 otherwise.
    pub draft: i32,
    pub number: i32,
    pub package: &'a str,
    pub title: &'a str,
    pub html_url: &'a str,
}