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
use crate::database::MyJsonType;

use super::schema::frames;
use chrono::NaiveDateTime;
use diesel::{Insertable, Queryable};
#[derive(Queryable, Clone, Identifiable, Debug)]
pub struct Frame {
    pub id: String,
    pub start: NaiveDateTime,
    pub end: Option<NaiveDateTime>,
    pub last_update: NaiveDateTime,
    pub project: String,
    pub tags: MyJsonType,
    pub deleted: bool,
}

#[derive(Insertable)]
#[diesel(table_name = frames)]
pub struct NewFrame<'a> {
    pub id: &'a str,
    pub start: &'a NaiveDateTime,
    pub end: Option<&'a NaiveDateTime>,
    pub last_update: &'a NaiveDateTime,
    pub project: &'a str,
    pub tags: &'a MyJsonType,
    pub deleted: &'a bool,
}