Remove published and updated columns.

This commit is contained in:
Dessalines 2024-03-04 09:30:21 -05:00
parent 8f7fd945c5
commit d0e25e8390
5 changed files with 1 additions and 15 deletions

View File

@ -18,7 +18,7 @@ use lemmy_db_schema::{
person::{Person, PersonUpdateForm},
},
traits::Crud,
utils::{diesel_option_overwrite, naive_now},
utils::diesel_option_overwrite,
};
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::{
@ -143,8 +143,6 @@ pub async fn save_user_settings(
upvotes: data.show_upvotes,
downvotes: data.show_downvotes,
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)
.await?;

View File

@ -147,7 +147,6 @@ pub async fn import_settings(
.vote_display_mode_settings
.as_ref()
.map(|s| s.upvote_percentage),
..Default::default()
};
LocalUserVoteDisplayMode::update(

View File

@ -461,8 +461,6 @@ diesel::table! {
upvotes -> Bool,
downvotes -> Bool,
upvote_percentage -> Bool,
published -> Timestamptz,
updated -> Nullable<Timestamptz>,
}
}

View File

@ -1,7 +1,6 @@
use crate::newtypes::LocalUserId;
#[cfg(feature = "full")]
use crate::schema::local_user_vote_display_mode;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
#[cfg(feature = "full")]
@ -26,8 +25,6 @@ pub struct LocalUserVoteDisplayMode {
pub upvotes: bool,
pub downvotes: bool,
pub upvote_percentage: bool,
pub published: DateTime<Utc>,
pub updated: Option<DateTime<Utc>>,
}
#[derive(Clone, TypedBuilder)]
@ -41,8 +38,6 @@ pub struct LocalUserVoteDisplayModeInsertForm {
pub upvotes: Option<bool>,
pub downvotes: Option<bool>,
pub upvote_percentage: Option<bool>,
pub published: Option<DateTime<Utc>>,
pub updated: Option<DateTime<Utc>>,
}
#[derive(Clone, Default)]
@ -53,6 +48,4 @@ pub struct LocalUserVoteDisplayModeUpdateForm {
pub upvotes: Option<bool>,
pub downvotes: Option<bool>,
pub upvote_percentage: Option<bool>,
pub published: Option<DateTime<Utc>>,
pub updated: Option<Option<DateTime<Utc>>>,
}

View File

@ -6,8 +6,6 @@ CREATE TABLE local_user_vote_display_mode (
upvotes boolean DEFAULT FALSE NOT NULL,
downvotes boolean DEFAULT FALSE 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)
);