mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-07-01 19:50:34 +00:00
c27d2a5687
* Add support for Taglines * recreate migration * Update content column -> Text * Optimize replace function * Change taglines to Option * Move Ok() call * Move taglines to GetSiteResponse * Fix logic Co-authored-by: layla <layla@chapo.dev> Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
29 lines
880 B
Rust
29 lines
880 B
Rust
use crate::newtypes::LocalSiteId;
|
|
#[cfg(feature = "full")]
|
|
use crate::schema::tagline;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
|
|
#[cfg_attr(
|
|
feature = "full",
|
|
diesel(belongs_to(crate::source::local_site::LocalSite))
|
|
)]
|
|
pub struct Tagline {
|
|
pub id: i32,
|
|
pub local_site_id: LocalSiteId,
|
|
pub content: String,
|
|
pub published: chrono::NaiveDateTime,
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
}
|
|
|
|
#[derive(Clone, Default)]
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
|
|
pub struct TaglineForm {
|
|
pub local_site_id: LocalSiteId,
|
|
pub content: String,
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
}
|