From 8fac1b756cf953be5f5d110dc8d201850397d6b3 Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Wed, 31 Mar 2021 15:44:15 -0400 Subject: [PATCH] Optimization:Remove Twitter Counts From User Table in db (#13208) --- app/models/user.rb | 1 - .../20210331181505_remove_twitter_counts_from_user.rb | 8 ++++++++ db/schema.rb | 4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20210331181505_remove_twitter_counts_from_user.rb diff --git a/app/models/user.rb b/app/models/user.rb index c82583496..6bdbd44aa 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,5 @@ class User < ApplicationRecord resourcify - self.ignored_columns = %w[twitter_following_count twitter_followers_count] include CloudinaryHelper include Searchable diff --git a/db/migrate/20210331181505_remove_twitter_counts_from_user.rb b/db/migrate/20210331181505_remove_twitter_counts_from_user.rb new file mode 100644 index 000000000..36f24e2a0 --- /dev/null +++ b/db/migrate/20210331181505_remove_twitter_counts_from_user.rb @@ -0,0 +1,8 @@ +class RemoveTwitterCountsFromUser < ActiveRecord::Migration[6.0] + def change + safety_assured do + remove_column :users, :twitter_following_count, :integer + remove_column :users, :twitter_followers_count, :integer + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 49c280df6..c425c4c36 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_03_26_172406) do +ActiveRecord::Schema.define(version: 2021_03_31_181505) do # These are extensions that must be enabled in order to support this database enable_extension "citext" @@ -1323,8 +1323,6 @@ ActiveRecord::Schema.define(version: 2021_03_26_172406) do t.string "text_color_hex" t.string "twitch_url" t.datetime "twitter_created_at" - t.integer "twitter_followers_count" - t.integer "twitter_following_count" t.string "twitter_username" t.string "unconfirmed_email" t.string "unlock_token"