From 84794714da5878264ac4f98902d6147c5b1063d9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 10 Sep 2024 14:27:17 -0400 Subject: [PATCH] Removing local_user.show_scores column, since its now on the (#4497) local_user_vote_display_mode table. - See https://github.com/LemmyNet/lemmy/pull/4450 --- crates/api/src/local_user/save_settings.rs | 1 - crates/apub/src/api/user_settings_backup.rs | 1 - crates/db_schema/src/schema.rs | 1 - crates/db_schema/src/source/local_user.rs | 6 ------ crates/db_views/src/registration_application_view.rs | 1 - .../2024-03-04-143245_remove_show_scores_column/down.sql | 3 +++ .../2024-03-04-143245_remove_show_scores_column/up.sql | 3 +++ 7 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 migrations/2024-03-04-143245_remove_show_scores_column/down.sql create mode 100644 migrations/2024-03-04-143245_remove_show_scores_column/up.sql diff --git a/crates/api/src/local_user/save_settings.rs b/crates/api/src/local_user/save_settings.rs index 193f9d269..13bdd3646 100644 --- a/crates/api/src/local_user/save_settings.rs +++ b/crates/api/src/local_user/save_settings.rs @@ -135,7 +135,6 @@ pub async fn save_user_settings( blur_nsfw: data.blur_nsfw, auto_expand: data.auto_expand, show_bot_accounts: data.show_bot_accounts, - show_scores: data.show_scores, default_sort_type, default_listing_type, theme: data.theme.clone(), diff --git a/crates/apub/src/api/user_settings_backup.rs b/crates/apub/src/api/user_settings_backup.rs index a0879b3c9..fdf8dc2ad 100644 --- a/crates/apub/src/api/user_settings_backup.rs +++ b/crates/apub/src/api/user_settings_backup.rs @@ -122,7 +122,6 @@ pub async fn import_settings( .settings .as_ref() .map(|s| s.send_notifications_to_email), - show_scores: data.settings.as_ref().map(|s| s.show_scores), show_bot_accounts: data.settings.as_ref().map(|s| s.show_bot_accounts), show_read_posts: data.settings.as_ref().map(|s| s.show_read_posts), open_links_in_new_tab: data.settings.as_ref().map(|s| s.open_links_in_new_tab), diff --git a/crates/db_schema/src/schema.rs b/crates/db_schema/src/schema.rs index fc418ec28..c78acfe37 100644 --- a/crates/db_schema/src/schema.rs +++ b/crates/db_schema/src/schema.rs @@ -446,7 +446,6 @@ diesel::table! { interface_language -> Varchar, show_avatars -> Bool, send_notifications_to_email -> Bool, - show_scores -> Bool, show_bot_accounts -> Bool, show_read_posts -> Bool, email_verified -> Bool, diff --git a/crates/db_schema/src/source/local_user.rs b/crates/db_schema/src/source/local_user.rs index c7a5b5224..89bdb1b55 100644 --- a/crates/db_schema/src/source/local_user.rs +++ b/crates/db_schema/src/source/local_user.rs @@ -35,9 +35,6 @@ pub struct LocalUser { /// Whether to show avatars. pub show_avatars: bool, pub send_notifications_to_email: bool, - /// Whether to show comment / post scores. - // TODO now that there is a vote_display_mode, this can be gotten rid of in future releases. - pub show_scores: bool, /// Whether to show bot accounts. pub show_bot_accounts: bool, /// Whether to show read posts. @@ -93,8 +90,6 @@ pub struct LocalUserInsertForm { #[new(default)] pub show_bot_accounts: Option, #[new(default)] - pub show_scores: Option, - #[new(default)] pub show_read_posts: Option, #[new(default)] pub email_verified: Option, @@ -138,7 +133,6 @@ pub struct LocalUserUpdateForm { pub show_avatars: Option, pub send_notifications_to_email: Option, pub show_bot_accounts: Option, - pub show_scores: Option, pub show_read_posts: Option, pub email_verified: Option, pub accepted_application: Option, diff --git a/crates/db_views/src/registration_application_view.rs b/crates/db_views/src/registration_application_view.rs index 54c7f7598..6f806be13 100644 --- a/crates/db_views/src/registration_application_view.rs +++ b/crates/db_views/src/registration_application_view.rs @@ -252,7 +252,6 @@ mod tests { show_avatars: inserted_sara_local_user.show_avatars, send_notifications_to_email: inserted_sara_local_user.send_notifications_to_email, show_bot_accounts: inserted_sara_local_user.show_bot_accounts, - show_scores: inserted_sara_local_user.show_scores, show_read_posts: inserted_sara_local_user.show_read_posts, email_verified: inserted_sara_local_user.email_verified, accepted_application: inserted_sara_local_user.accepted_application, diff --git a/migrations/2024-03-04-143245_remove_show_scores_column/down.sql b/migrations/2024-03-04-143245_remove_show_scores_column/down.sql new file mode 100644 index 000000000..5669e96bd --- /dev/null +++ b/migrations/2024-03-04-143245_remove_show_scores_column/down.sql @@ -0,0 +1,3 @@ +ALTER TABLE local_user + ADD COLUMN show_scores boolean NOT NULL DEFAULT TRUE; + diff --git a/migrations/2024-03-04-143245_remove_show_scores_column/up.sql b/migrations/2024-03-04-143245_remove_show_scores_column/up.sql new file mode 100644 index 000000000..20fc01c4e --- /dev/null +++ b/migrations/2024-03-04-143245_remove_show_scores_column/up.sql @@ -0,0 +1,3 @@ +ALTER TABLE local_user + DROP COLUMN show_scores; +