use diesel::{Associations, Identifiable, Insertable, Queryable, QueryableByName, Selectable}; use uuid::Uuid; use super::schema; #[derive(Debug, Queryable, QueryableByName, Identifiable, Selectable, Insertable)] #[diesel(table_name = schema::meta_aliases)] pub struct MetaAlias { pub id: Uuid, pub pattern: String, pub alias: String, } #[derive(Debug, Queryable, QueryableByName, Identifiable, Selectable, Insertable)] #[diesel(table_name = schema::meta_links)] pub struct MetaLink { pub id: Uuid, pub pattern: String, pub rel: String, pub type_: Option, pub href: Option, } #[derive(Debug, Queryable, QueryableByName, Identifiable, Selectable, Insertable, Associations)] #[diesel(belongs_to(MetaLink))] #[diesel(table_name = schema::meta_link_properties)] pub struct MetaLinkProperty { pub id: Uuid, pub meta_link_id: Uuid, pub rel: String, pub value: Option, } #[derive(Debug, Queryable, QueryableByName, Identifiable, Selectable, Insertable)] #[diesel(table_name = schema::meta_properties)] pub struct MetaProperty { pub id: Uuid, pub pattern: String, pub value: Option, }