Optimization:Remove Twitter Counts From User Table in db (#13208)

This commit is contained in:
Molly Struve 2021-03-31 15:44:15 -04:00 committed by GitHub
parent 3b61179515
commit 8fac1b756c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -1,6 +1,5 @@
class User < ApplicationRecord
resourcify
self.ignored_columns = %w[twitter_following_count twitter_followers_count]
include CloudinaryHelper
include Searchable

View file

@ -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

View file

@ -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"