mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-02 13:39:21 +00:00
514f2222e0
* convert naive time to utc time * compounding fixes * cargo fmt * fix the rest * fix down migration * fix migrations * fix after merge * clippy fix * ap-fed 0.5.0 --------- Co-authored-by: Nutomic <me@nutomic.com>
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
use crate::newtypes::LocalSiteId;
|
|
#[cfg(feature = "full")]
|
|
use crate::schema::tagline;
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
use serde_with::skip_serializing_none;
|
|
#[cfg(feature = "full")]
|
|
use ts_rs::TS;
|
|
|
|
#[skip_serializing_none]
|
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
|
|
#[cfg_attr(
|
|
feature = "full",
|
|
diesel(belongs_to(crate::source::local_site::LocalSite))
|
|
)]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
/// A tagline, shown at the top of your site.
|
|
pub struct Tagline {
|
|
pub id: i32,
|
|
pub local_site_id: LocalSiteId,
|
|
pub content: String,
|
|
pub published: DateTime<Utc>,
|
|
pub updated: Option<DateTime<Utc>>,
|
|
}
|
|
|
|
#[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<DateTime<Utc>>,
|
|
}
|