summaryrefslogtreecommitdiffstats
path: root/src/artwork.rs
blob: 458fd38ce44d13c928be65a6a7070d036adc790a (plain) (blame)
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 time::{OffsetDateTime, PrimitiveDateTime};
use uuid::Uuid;

use crate::{artist::Artist, comment::Comment, file::File};

#[derive(sqlx::FromRow)]
pub struct Artwork {
    /// artwork id
    id: Option<i32>,
    /// name of the artwork
    pub title: Option<String>,
    /// description of the artwork
    pub description: Option<String>,
    /// source url of the artwork
    pub url_source: Option<String>,
    /// artwork creation time
    created_at: Option<PrimitiveDateTime>,
    /// id of the artist
    #[sqlx(Flatten)]
    pub artist: Artist,
    /// ids of files
    #[sqlx(Flatten)]
    pub files: Vec<File>,
    // /// TODO: comments in thread,
    // #[sqlx(Flatten)]
    // comments: Vec<Comment>,
}