mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-18 11:55:19 +00:00
Remove published and updated columns.
This commit is contained in:
parent
8f7fd945c5
commit
d0e25e8390
5 changed files with 1 additions and 15 deletions
|
@ -18,7 +18,7 @@ use lemmy_db_schema::{
|
||||||
person::{Person, PersonUpdateForm},
|
person::{Person, PersonUpdateForm},
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
utils::{diesel_option_overwrite, naive_now},
|
utils::diesel_option_overwrite,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
|
@ -143,8 +143,6 @@ pub async fn save_user_settings(
|
||||||
upvotes: data.show_upvotes,
|
upvotes: data.show_upvotes,
|
||||||
downvotes: data.show_downvotes,
|
downvotes: data.show_downvotes,
|
||||||
upvote_percentage: data.show_upvote_percentage,
|
upvote_percentage: data.show_upvote_percentage,
|
||||||
updated: Some(Some(naive_now())),
|
|
||||||
..Default::default()
|
|
||||||
};
|
};
|
||||||
LocalUserVoteDisplayMode::update(&mut context.pool(), local_user_id, &vote_display_modes_form)
|
LocalUserVoteDisplayMode::update(&mut context.pool(), local_user_id, &vote_display_modes_form)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
|
@ -147,7 +147,6 @@ pub async fn import_settings(
|
||||||
.vote_display_mode_settings
|
.vote_display_mode_settings
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|s| s.upvote_percentage),
|
.map(|s| s.upvote_percentage),
|
||||||
..Default::default()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LocalUserVoteDisplayMode::update(
|
LocalUserVoteDisplayMode::update(
|
||||||
|
|
|
@ -461,8 +461,6 @@ diesel::table! {
|
||||||
upvotes -> Bool,
|
upvotes -> Bool,
|
||||||
downvotes -> Bool,
|
downvotes -> Bool,
|
||||||
upvote_percentage -> Bool,
|
upvote_percentage -> Bool,
|
||||||
published -> Timestamptz,
|
|
||||||
updated -> Nullable<Timestamptz>,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::newtypes::LocalUserId;
|
use crate::newtypes::LocalUserId;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::local_user_vote_display_mode;
|
use crate::schema::local_user_vote_display_mode;
|
||||||
use chrono::{DateTime, Utc};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::skip_serializing_none;
|
use serde_with::skip_serializing_none;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
|
@ -26,8 +25,6 @@ pub struct LocalUserVoteDisplayMode {
|
||||||
pub upvotes: bool,
|
pub upvotes: bool,
|
||||||
pub downvotes: bool,
|
pub downvotes: bool,
|
||||||
pub upvote_percentage: bool,
|
pub upvote_percentage: bool,
|
||||||
pub published: DateTime<Utc>,
|
|
||||||
pub updated: Option<DateTime<Utc>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, TypedBuilder)]
|
#[derive(Clone, TypedBuilder)]
|
||||||
|
@ -41,8 +38,6 @@ pub struct LocalUserVoteDisplayModeInsertForm {
|
||||||
pub upvotes: Option<bool>,
|
pub upvotes: Option<bool>,
|
||||||
pub downvotes: Option<bool>,
|
pub downvotes: Option<bool>,
|
||||||
pub upvote_percentage: Option<bool>,
|
pub upvote_percentage: Option<bool>,
|
||||||
pub published: Option<DateTime<Utc>>,
|
|
||||||
pub updated: Option<DateTime<Utc>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
|
@ -53,6 +48,4 @@ pub struct LocalUserVoteDisplayModeUpdateForm {
|
||||||
pub upvotes: Option<bool>,
|
pub upvotes: Option<bool>,
|
||||||
pub downvotes: Option<bool>,
|
pub downvotes: Option<bool>,
|
||||||
pub upvote_percentage: Option<bool>,
|
pub upvote_percentage: Option<bool>,
|
||||||
pub published: Option<DateTime<Utc>>,
|
|
||||||
pub updated: Option<Option<DateTime<Utc>>>,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ CREATE TABLE local_user_vote_display_mode (
|
||||||
upvotes boolean DEFAULT FALSE NOT NULL,
|
upvotes boolean DEFAULT FALSE NOT NULL,
|
||||||
downvotes boolean DEFAULT FALSE NOT NULL,
|
downvotes boolean DEFAULT FALSE NOT NULL,
|
||||||
upvote_percentage boolean DEFAULT TRUE NOT NULL,
|
upvote_percentage boolean DEFAULT TRUE NOT NULL,
|
||||||
published timestamp with time zone NOT NULL DEFAULT now(),
|
|
||||||
updated timestamp with time zone,
|
|
||||||
PRIMARY KEY (local_user_id)
|
PRIMARY KEY (local_user_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue