Browse Source

Remove unused `filtered_languages` column (#18533)

* Remove unused `filtered_languages` column

Fixes #18522

* Fix tests
closed-social-glitch-2
Claire 2 years ago
committed by GitHub
parent
commit
e34dd3644c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions
  1. +1
    -1
      app/models/user.rb
  2. +11
    -0
      db/post_migrate/20220527114923_remove_filtered_languages_from_users.rb
  3. +1
    -2
      db/schema.rb
  4. +1
    -1
      spec/controllers/settings/preferences/other_controller_spec.rb

+ 1
- 1
app/models/user.rb View File

@ -26,7 +26,6 @@
# otp_required_for_login :boolean default(FALSE), not null
# last_emailed_at :datetime
# otp_backup_codes :string is an Array
# filtered_languages :string default([]), not null, is an Array
# account_id :bigint(8) not null
# disabled :boolean default(FALSE), not null
# moderator :boolean default(FALSE), not null
@ -48,6 +47,7 @@ class User < ApplicationRecord
current_sign_in_ip
last_sign_in_ip
skip_sign_in_token
filtered_languages
)
include Settings::Extend

+ 11
- 0
db/post_migrate/20220527114923_remove_filtered_languages_from_users.rb View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class RemoveFilteredLanguagesFromUsers < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
safety_assured do
remove_column :users, :filtered_languages, :string, array: true, default: [], null: false
end
end
end

+ 1
- 2
db/schema.rb View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_04_29_101850) do
ActiveRecord::Schema.define(version: 2022_05_27_114923) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -983,7 +983,6 @@ ActiveRecord::Schema.define(version: 2022_04_29_101850) do
t.boolean "otp_required_for_login", default: false, null: false
t.datetime "last_emailed_at"
t.string "otp_backup_codes", array: true
t.string "filtered_languages", default: [], null: false, array: true
t.bigint "account_id", null: false
t.boolean "disabled", default: false, null: false
t.boolean "moderator", default: false, null: false

+ 1
- 1
spec/controllers/settings/preferences/other_controller_spec.rb View File

@ -3,7 +3,7 @@ require 'rails_helper'
describe Settings::Preferences::OtherController do
render_views
let(:user) { Fabricate(:user, filtered_languages: []) }
let(:user) { Fabricate(:user, chosen_languages: []) }
before do
sign_in user, scope: :user

Loading…
Cancel
Save