From d0e25e839024a7faed09d14e7fa790adcfa57541 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 4 Mar 2024 09:30:21 -0500 Subject: [PATCH] Remove published and updated columns. --- crates/api/src/local_user/save_settings.rs | 4 +--- crates/apub/src/api/user_settings_backup.rs | 1 - crates/db_schema/src/schema.rs | 2 -- .../db_schema/src/source/local_user_vote_display_mode.rs | 7 ------- .../2024-02-12-211114_add_vote_display_mode_setting/up.sql | 2 -- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/crates/api/src/local_user/save_settings.rs b/crates/api/src/local_user/save_settings.rs index aa4c92a1c..d918bdc00 100644 --- a/crates/api/src/local_user/save_settings.rs +++ b/crates/api/src/local_user/save_settings.rs @@ -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?; diff --git a/crates/apub/src/api/user_settings_backup.rs b/crates/apub/src/api/user_settings_backup.rs index ffb682623..a2e6c55ac 100644 --- a/crates/apub/src/api/user_settings_backup.rs +++ b/crates/apub/src/api/user_settings_backup.rs @@ -147,7 +147,6 @@ pub async fn import_settings( .vote_display_mode_settings .as_ref() .map(|s| s.upvote_percentage), - ..Default::default() }; LocalUserVoteDisplayMode::update( diff --git a/crates/db_schema/src/schema.rs b/crates/db_schema/src/schema.rs index 8f0b180e6..688f0f354 100644 --- a/crates/db_schema/src/schema.rs +++ b/crates/db_schema/src/schema.rs @@ -461,8 +461,6 @@ diesel::table! { upvotes -> Bool, downvotes -> Bool, upvote_percentage -> Bool, - published -> Timestamptz, - updated -> Nullable, } } diff --git a/crates/db_schema/src/source/local_user_vote_display_mode.rs b/crates/db_schema/src/source/local_user_vote_display_mode.rs index e98bc7e2f..314d99e4a 100644 --- a/crates/db_schema/src/source/local_user_vote_display_mode.rs +++ b/crates/db_schema/src/source/local_user_vote_display_mode.rs @@ -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, - pub updated: Option>, } #[derive(Clone, TypedBuilder)] @@ -41,8 +38,6 @@ pub struct LocalUserVoteDisplayModeInsertForm { pub upvotes: Option, pub downvotes: Option, pub upvote_percentage: Option, - pub published: Option>, - pub updated: Option>, } #[derive(Clone, Default)] @@ -53,6 +48,4 @@ pub struct LocalUserVoteDisplayModeUpdateForm { pub upvotes: Option, pub downvotes: Option, pub upvote_percentage: Option, - pub published: Option>, - pub updated: Option>>, } diff --git a/migrations/2024-02-12-211114_add_vote_display_mode_setting/up.sql b/migrations/2024-02-12-211114_add_vote_display_mode_setting/up.sql index 99086e69c..a76e3c122 100644 --- a/migrations/2024-02-12-211114_add_vote_display_mode_setting/up.sql +++ b/migrations/2024-02-12-211114_add_vote_display_mode_setting/up.sql @@ -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) );