1
Fork 0

core: Add base core::meta structs

This commit is contained in:
Steffo 2024-11-15 02:16:16 +01:00
parent 2ca4bb3662
commit 21842d9f80
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -0,0 +1,41 @@
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<String>,
pub href: Option<String>,
}
#[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<String>,
}
#[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<String>,
}