media-collection-crud/src/models.rs

34 lines
634 B
Rust
Raw Normal View History

2019-03-28 17:24:19 -04:00
use diesel::Queryable;
// use crate::schema::*;
#[derive(Queryable)]
// #[table_name="media"]
pub struct Media {
pub id: u32,
pub display_name: String,
pub notes: String,
}
#[derive(Queryable)]
// #[table_name="media_type"]
pub struct MediaType {
pub id: u32,
pub type_name: String,
pub description: String,
}
#[derive(Queryable)]
// #[table_name="media_format"]
pub struct MediaFormat {
pub id: u32,
pub is_physical: bool,
pub format_name: String,
pub description: String,
}
#[derive(Queryable)]
pub struct MediaTypeFormatLink {
pub media_type_id: i32,
pub media_format_id: i32,
}